For my latest project I want to be able to make my BlitzMAx application communicate with the outside world.
A colleague of mine has written a test dll in C#. Now I'm trying to call the functions in the dll but with no success.
I found some examples but I can't make it work.
Here is the BlitzMAx code:
When I run this it says:
Unhandled Exception:Attempt to call uninitialized function pointer
when reaching the line: Print hello()
Seaching the forum and the internet doesn't bring me any further. So, I was hoping anyone in the community could help me.
A colleague of mine has written a test dll in C#. Now I'm trying to call the functions in the dll but with no success.
I found some examples but I can't make it work.
Here is the BlitzMAx code:
Strict Global hello:String() "c" Global ask(s:String) "c" Global add:Int(i:Int, j:Int) "c" Global ThisDLL = LoadLibraryA("BlitzTest.dll") If ThisDLL = Null Then Print "Oops, no dll init" Else hello = GetProcAddress(ThisDLL, "SimpleMethods.Hello") ask = GetProcAddress(ThisDLL, "SimpleMethods.Ask") add = GetProcAddress(ThisDLL, "SimpleMethods.Add") 'Or is it something like this: ' hello = GetProcAddress(ThisDLL, "Hello") ' ask = GetProcAddress(ThisDLL, "Ask") ' add = GetProcAddress(ThisDLL, "Add") End If Print hello() Print add(3,4) End Rem These are the available functions in the DLL String SimpleMethods.Hello () String SimpleMethods.Ask (String) Int SimpleMethods.Add (Int, Int) end rem
When I run this it says:
Unhandled Exception:Attempt to call uninitialized function pointer
when reaching the line: Print hello()
Seaching the forum and the internet doesn't bring me any further. So, I was hoping anyone in the community could help me.