关于VB向VC++的DLL传递数组的问题
DLL中的代码: void _stdcall xydll(int x[21],int y[21])
{int i;
for(i=1;i<=20;i++)
{x[i]=i;
y[i]=x[i]+2;}
}
VB中代码是:
Private Declare Sub xydll Lib "d:\xydll.dll" (x() As Integer, y() As Integer)
Private Sub Command1_Click()
Dim x(20) As Integer
Dim y(20) As Integer
x(0) = Text1.Text
y(0) = Text2.Text
Call xydll(x(0), y(0))
With TChart1
.Series(0).Clear
For i = 0 To 20
Series(0).Add y(i), x(i), clTeeColor
Next
End With
End Sub
程序运行之后,老是出现 类型不匹配:缺少数组或用户定于类型。
希望高手们能够指点一下这是怎么回事,谢谢了、、