DLLs?

BlitzMax Forums/BlitzMax Beginners Area/DLLs?

Kuron(Posted 2005) [#1]
Stupid question, but I have hit a snag. How do I access a DLL in BMax? (DLL works fine with B+ but can't figure it out in BMax)

Thank you in advance for any help.


BlitzSupport(Posted 2005) [#2]
Something like this should do it...

' Declare functions (will point to DLL functions)...

Global InitGame (x, y, x) "win32"

' Load DLL...

lib = LoadLibraryA ("biglib.dll")

If lib

    ' Assign DLL function "DoStuff" to "InitGame" function...

    InitGame = GetProcAddress (lib, "DoStuff")
    If InitGame = Null Then Notify "Doh!"; End

    ' More...

EndIf

' Call function...

result = InitGame (1, 2, 3)



Kuron(Posted 2005) [#3]
Thank you, Mr. James :c)