Howto use DLL's?

BlitzMax Forums/BlitzMax Beginners Area/Howto use DLL's?

Woohoo!, found it.... I needed Int instead of Long.
I tried the following code and the dll gave me back the results.

Global QAPIExtOpenCard (cardid:Int, devnum:Int) "win32"
Global QAPIExtCloseCard (cardhandle:Int) "win32"
Global QAPIExtWriteDO32 (cardhandle:Int, channel:Int, value:Int, mode:Int) "win32"
Global QAPIExtNumOfCards ()

dll = LoadlibraryA ("qlib32")

If dll=Null
 Print "Dammit"
 End
EndIf

QAPIExtNumOfCards = GetProcAddress(dll, "QAPIExtNumOfCards")
QAPIExtOpenCard = GetProcAddress(dll, "QAPIExtOpenCard")
QAPIExtWriteDO32 = GetProcAddress(dll, "QAPIExtWriteDO32")
QAPIExtCloseCard = GetProcAddress(dll, "QAPIExtCloseCard")


Local handle:Int = QAPIExtOpenCard(67,1)

Print handle
Print QAPIExtNumOfCards()


I only need to test it with my relais card connected when I get home. But I'm glad I know how to work with dll's now... took me some days