在vc下输出的dll,在vb下调用出错函数输出正常,用Depends能看到其输出函数
怎会在c = Test(a, b)提示Dll调用约定错误?//vc下输出函数
int Test(int a,int b)
{
return a+b;
}
'vb下声明调用
Private Declare Function Test Lib "121.dll" (ByVal a As Long, ByVal b As Long) As Long
Private Sub Command1_Click()
Dim c As Long
Dim a As Long
Dim b As Long
a = 1
b = 2
c = Test(a, b)
End Sub
怎会在c = Test(a, b)提示Dll调用约定错误?//vc下输出函数
int Test(int a,int b)
{
return a+b;
}
'vb下声明调用
Private Declare Function Test Lib "121.dll" (ByVal a As Long, ByVal b As Long) As Long
Private Sub Command1_Click()
Dim c As Long
Dim a As Long
Dim b As Long
a = 1
b = 2
c = Test(a, b)
End Sub
你定义的是long
调用的是int
我也正在用VB调用C++的DLL.
{
return a+b;
}