剛知道aardio這個不錯的玩具,惋惜做者停更了,貼一個調用dll的例子備用吧api
vc代碼函數
extern "C" _declspec(dllexport) int _stdcall my_export(int a,int b) { return a + b; }
def文件spa
LIBRARY "my_dll" EXPORTS my_export
aardio代碼code
mainForm.button.oncommand = function(id,event){ //後面默認是stdcall調用,寫錯會各類崩潰 dll = raw.loadDll("D:\projects\vc\my_dll\Debug\my_dll.dll"); /* MyExportFunc = dll.api("my_export","int(int, int)"); result = MyExportFunc(1, 2); */ //函數能夠直接調用 result = dll.my_export(1,2) win.msgbox(tostring(result)) }