Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: dllcall binary buffer
b=0 a1=dllcall(dllname, void:"MyTest", word:b) Message("b is ", b)The MyTest function in the DLL returns some calculated value. The C++ Dll looks like this:
__declspec(dllexport) void WINAPI PASCAL MyTest(int* len) { int i; i = 43; *len = i; }The Dll compiles and links ok but when I run the WinBatch, the value of b is displayed as 0 not the expected 43. I have success passing back string values using char* and lpbinary but not with int* and long (or word). Any ideas what I am missing?
If I forget the b=0 statement before the dllcall, WinBatch aborts with a "Tag Overwrite 1" error message. But I guess that is supposed to happen.
bb=BinaryAlloc(4) BinaryEODSet(bb,4) a1=dllcall(dllname, void:"MyTest", lpbinary:bb) b=BinaryPeek4(bb,0) BinaryFree(bb) Message("b is ", b)
Article ID: W12870
Filename: Using Dll Created in C to Pass Address.txt
File Created: 1999:04:15:16:50:12
Last Updated: 1999:04:15:16:50:12