Hi! I just started learning C# and stucked with this problem I encountered while accessing a VB6 OCX function from C#.
VB6 OCX Code is:
Public Function AreaByCoords(ByRef X() As Double, ByRef Y() As Double) As Double Dim L As Long Dim H As Long Dim I As Long Dim A As Double L = LBound(X) H = UBound(X) ' If (H - L) < 3 Then Exit Function ' A = 0 For I = L To H A = A + Y(I) * IIf(I = H, X(L), X(I + 1)) - X(I) * IIf(I = H, Y(L), Y(I + 1)) Next I AreaByCoords = A / 2End Function
Public Function IAdd(A As Double, B As Double) As Double IAdd = A + BEnd Function
C# Code:
{
C =
C[0] = 1.542;
C[1] = 2.285;
C[2] = -2.234;
C[3] = -2.521;
D =
D[0] = 1.642;
D[1] = -2.585;
D[2] = -2.234;
D[3] = 2.826;
A = 2.345;
B = 4.321;
V = axP1029.IAdd(
V = axP1029.AreaByCoords (
}
Running the above code, the following errors are displayed:
Error 1 The best overloaded method match for 'AxPo1030.AxP1029.AreaByCoords(ref System.Array, ref System.Array)' has some invalid arguments Error 2 Argument '1': cannot convert from 'ref double[]' to 'ref System.Array' Error 3 Argument '2': cannot convert from 'ref double[]' to 'ref System.Array'
Any idea how to set this right? All suggestions are much appreciated. Thank you in anticipation.