Hi,
I'm trying to send an array to a dll, but I can't send it. My application crashes.
the function in my dll is (written in C):
the code in BlitzMax is:
Could anyone help me ?
I'm trying to send an array to a dll, but I can't send it. My application crashes.
the function in my dll is (written in C):
void ModifieTableau (int ptr[10]) { int i; for (i=0; i<10; i++) { ptr[i] = 15; } }
the code in BlitzMax is:
Const DllName:String = "dllTest.dll" Local DllHandle = LoadLibraryA(DllName) If DLLhandle = 0 Then Notify "Unable to initialize dllTest.dll" End EndIf Global HelloWorld()"Win32" = GetProcAddress(DllHandle,"HelloWorld") Global EnvoieValeur:Int(a:Int)"Win32" = GetProcAddress(DllHandle,"EnvoieValeur") Global ModifieTableau(tab:Int Ptr)"Win32" = GetProcAddress(DllHandle,"ModifieTableau") Local tableau:Int[10] Local tab_ptr:Int Ptr tab_ptr = Varptr tableau[0] For i = 0 To 9 tableau[i] = 5 Next For i = 0 To 9 Print(tableau[i]) Next ModifieTableau(tab_ptr) ' Application cashes here "Unhandled exception: Attempt to call uninitialize function pointer" For i = 0 To 9 Print(tableau[i]) Next
Could anyone help me ?