passing pointer to dll function
BlitzMax Forums/BlitzMax Programming/passing pointer to dll function
| ||
Hi, I am trying to pass a pointer to the a dll function the code in BlitzMax is as follows: Local width:Int=0 Local varbnk:TBank=CreateStaticBank(Varptr width,4) DllFunction(Varptr width) In the c++ code: int DllFunction(int *width) { printf("%d",*width) } The variable is not getting passed properly Please advise |
| ||
I also tried passing Varptr width directly to function but it didn't work. I could not get any help from previous posts so I hope to get some help here |
| ||
extern function DLLFunction:int(width:int ptr) end extern local width:int = 5 DLLFunction(varptr width) |
| ||
I am Getting the DllFunction using LoadLibraryA Local DllHandle=LoadLibraryA("dllname") Global DllFunction(width:Int Ptr)"win32"=GetProcAddress("dllname","DllFunction") Then Calling DllFunction(Varptr width) This doesn't work |
| ||
My C++ code : DllFunction(int *width) { using or modifying *width } I am derefencing the pointer in the c++ code using *width Shouldn't that should be OK? |
| ||
Not yet resolved |
| ||
Found the problem. That was a misdiagnosis. Thanks |