How to use a DLL?

BlitzMax Forums/BlitzMax Programming/How to use a DLL?

BlitzProg(Posted 2009) [#1]
I may seem stupid but the titles says it all... how to use a dll? I have a dll file and i would like to import it.

Very simple question, i don't know what to add =[]


kfprimm(Posted 2009) [#2]
http://www.blitzbasic.com/Community/posts.php?topic=41803
I would suggest using Drago's method as opposed to skidracer's, though both work and have the same end result.


BlitzProg(Posted 2009) [#3]
ok, wow, this looks way more complicated than i imaginated. This doesn't look like an "Extern" where you just tell which function to import or not then O_o


kfprimm(Posted 2009) [#4]
Did you look at this? It is pretty straight forward...well, compared to the other way.


BlitzProg(Posted 2009) [#5]
it stills doesn't look that simple! I never ever worked with imports and nothing about this seems to make sense (i mean i can't explain anything of why proceeding that way, lol)


Mahan(Posted 2009) [#6]
Skidracers method is the "classic dynamic library method". While Dragos method is very smooth, Skidracers allow you to create a program where 3:rd parties can actually replace the DLL, and enhance functionality.

A few days ago I did a working wrapper for the bbEnet dll (userlib originally intended for b3d and b+) for BlitzMax using the Skidracer method:

Link to bbEnet userlib: http://www.leidel.net/dl/bbenet.zip (made by Xaron)

This is a fully working example so I hope it might be useful for you as reference if you are creating another DLL wrapper.

(filename: enet_dll.bmx)


Here is a demo program that uses this wrapper, just to show it in action:



Hope it helps.