How do you call dll functions

BlitzMax Forums/BlitzMax Beginners Area/How do you call dll functions

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:
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.

A DLL is not the same as an assembly, which is the only thing you can create with C# directly.

Tell your friend to create a win32 DLL (CDecl DLL) or a wrapper DLL for it.
Otherwise yo ucan not use it.