What'#s the difference between CallDll() and decls

Blitz3D Forums/Blitz3D Userlibs/What'#s the difference between CallDll() and decls

_PJ_(Posted 2009) [#1]
Is there any 'real' difference between using CallDLL() and writing out a Decls file?

Is it that the two are the same kinda thing, only with Decls the functions are incorporated into the B3D commandset, while with CallDLL you need to specify the dll's command EVERY time?

Or am I completely on the wrong track as the two are chalk and cheesey? :)

__________________

Question 2:

On compiling .Exe's,

Do DLL files need to be: (multiple choice, this one)

In the userlobs folder with the .bb file?
In the userlibs folder of %ProgramFiles%/Blitz3D/ or wherever Blitz3D is installed?
Somewhere else (Polite answers only, please :D )

And.. what about any .decls files?
Same as above?
Different from the above, put them in...... ?


----------------------

Question 3:
I've compiled my Exe and want to sell it for squllions, one rich individual wants to pay that sum, so I'm gonna sell them the only copy. Do I need to provide:

The DLL files? If so, where should they be in relation to the .exe file?
The .decls files? If so, where should they be in relation to the .exe file?

If the DLLs used are generic windows once, i.e. Advapi32.dll etc. do these need to be included? What about decls?


Yasha(Posted 2009) [#2]
I think, because of the way it works, that CallDll is most likely considerably slower than using .decls, but don't quote me on this. More importantly, it's very limited and you pretty much have to use a bank to pass your arguments and return values, so unless you have a particularly pressing need for dynamic bindings I would say there isn't much reason to remember it exists.

Compiling an executable is the same, from a file point of view, as running the program: you will need to have your .decls and DLLs in place in the userlibs folder to compile it correctly.

The .decls files are only there to provide information to the compiler and don't need to be distributed with the program, any more than the .bb files do. DLLs need to be somewhere that the program will be able to find them: Windows DLLs are therefore in the system folders and best left to their own devices; others can be put in the same folder as the executable. I think, but haven't tested it, that you can also specify a path: if you put the DLL in a subfolder in \userlibs and then give its name in the .decls file as "subfolder\mydll.dll" it runs happily enough, so presumably you can also put it in the same location relative to your executable once it's been compiled.


_PJ_(Posted 2009) [#3]
That's great, thanks Yasha!