How do I make a dll wrapper

Blitz3D Forums/Blitz3D Programming/How do I make a dll wrapper

ckob(Posted 2004) [#1]
Well I asked this once but I didnt get many response's. I was looking for a good tutorial on how to make decl files and wrap dll's so that I can use custom dll's with blitz or so that I may wrap other dll's. I do not have extensive c++ knowledge but I am in the process of learning, I was under the impression that wrapping dll's was fairly easy but very time consuming is that true? if someone could point me to a good tutorial or kind of explain how I would go about wrapping a dll? the example that Blitz research made dosnt really explain much.


Dreamora(Posted 2004) [#2]
The problem with wrapping is that you have to wrap / emulate especially the object based stuff to something Blitz can handle: integers, floats or strings and handle the object based stuff using to this "indices".

There isn't much more "magic" which this topic as you simply call functions with the number of bytes which are used for input ( 4 bytes per variable, even for strings )


Difference(Posted 2004) [#3]
@ckob Do you want to:

1) Write headers for a dll.
2) Make a dll wrapper (a dll that calls a dll that Blitz otherwise can not use)


ckob(Posted 2004) [#4]
I think it would be option 2 :P say I was going to use a directx dll or something with blitz what would I need to do?


Dreamora(Posted 2004) [#5]
That is next to impossible. You would need to create a large system around DX to handle all its objects, interfaces etc so in the end you could write an engine in C++ or something like that and then compile it as Blitz usable DLL ...


ckob(Posted 2004) [#6]
I was using directx as an example lol,ok say I wanted to use a diffrent dll I dont know any dll all I want to do is be able to use it with blitz to use the features in the dll i dont know what I need to do maybe its option 1 *shrugs* not sure thats why I asked


Dreamora(Posted 2004) [#7]
You will need to create a system that handles the objects and interfaces of the dll and provides access and control over them with the possibilities of Blitz3D.

If the DLL is simple C or other non-oop stuff, the wrapper becomes easier.


ckob(Posted 2004) [#8]
tutorials...examples.. please


ckob(Posted 2004) [#9]
*Bump* I would really like some help if anyone could be so kind as to tell me were to find a good tutorial or even give me an example


Dreamora(Posted 2004) [#10]
for example tokamak wrapper which is opensource? :)


Rook Zimbabwe(Posted 2004) [#11]
ckob (Posted 2004-09-08 08:28:27)

tutorials...examples.. please

Maybe you would like him to write it for you as well???


ckob(Posted 2004) [#12]
yeah thanks for the idea...screw coding Dreamora can you just write it for me. If your not going to post something useful then please dont post.

Dreamora thanks ill look into that.


Sweenie(Posted 2004) [#13]
Recently I wrote a very simple DirectX9 wrapper just to see if I could get DX9 to render in blitz.
I could clean up the code and try to write a tutorial on it.
It's not much though, just three exported functions.
One to initialize the DX device, one to render and one to cleanup and release the DX objects.


Difference(Posted 2004) [#14]
tutorials...examples.. please

Follow the link in my signature for (almost) complete OpenGL 1.1 headers.


ckob(Posted 2004) [#15]
thanks everyone :)


Sweenie(Posted 2004) [#16]
I wrote a tutorial.
You find it here->
http://www.blitzbasic.com/Community/posts.php?topic=38319


ckob(Posted 2004) [#17]
thanks ill check it out