16,473
社区成员
发帖
与我相关
我的任务
分享
// C++ Code
// 没有使用 def文件和stdcall
/////////////////////////////////////////
//测试整数传入和传出
extern "C" __declspec(dllexport) int testSetGetInt(int iIn,
int &iOut);
//测试整数传入和传出
extern "C" __declspec(dllexport) int testSetGetInt(int iIn,
int &iOut)
{
iOut = iIn + 2;
return iOut;
}
'''''''''''''''''''''''''''''''''''''''''''''''''
'''''' test.bas
Option Explicit
'测试传入传出整数
Declare Function testSetGetInt Lib "test.dll" (ByVal intIn As Long, ByRef intOut As Long) As Long
'''''' Form1.frm
Option Explicit
'测试传入传出整数
Private Sub Command1_Click()
Dim aInput As Long
Dim bOutput As Long
Dim cRetVal As Long
aInput = 10
cRetVal = testSetGetInt(aInput, bOutput)
Print aInput, bOutput, cRetVal
End Sub