[VBA ] VBA呼叫BCB產生的DLL
Hi,各位高手
請問VBA如何呼叫BCB產生的DLL
我的BCB寫法如下
#include <windows.h>
#pragma argsused
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPvoid lpvReserved)
{
return 1;
}
//-
long __declspec(dllexport) __stdcall aaa(int m,int n)
{
long sum=0;
for(int m;m<=n;m++)
sum+=m;
return sum;
}
而VBA的寫法如下
private Declare function aaa Lib "aaa.DLL" _
(ByVal m as Integer, ByVal n as Integer) as long
private Sub CommandButton1_Click()
MsgBox aaa(1, 10)
End Sub
錯誤訊息如下:
"DLL進入點aaa無法在aaa.DLL中找到"
謝謝各位囉!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.4.33
推
11/08 08:23, , 1F
11/08 08:23, 1F
→
11/08 08:24, , 2F
11/08 08:24, 2F