I have developed a technique to use third party DLLs within a DarkBASIC Profesional program and yet distribute only a single "standalone" .exe file. For example, my networked COMMBAT program used Lagmaster's IP retrieval DLL, and the testers only needed to download and unzip a single executable module.
Part of this technique involves attachment of the DLL to the project. For me, the DBP IDE does not seem to recognize a DLL file as a type of media, so it does not allow me to directly attach a .dll file to the executable build. So I decieve the IDE by changing or removing the file extension, and then adding the file as media.
The other part of the technique is performed during the program initialization. Have the program copy the attached file to a folder, renaming it back to the proper .dll. The DLL is then available to be loaded and called by the program. Good housekeeping dictates the deletion of the renamed .dll from the disk as soon as it is loaded into the program.
I think that using this technique makes for nicer distributions, cleaner installations, and you will have the assurance of KNOWING the proper DLL is used by your program.
Are there any drawbacks to using this technique?
IP$= ""
If Path Exist(Windir$()+"\Temp")
FOLP$= ""
PATH$= Windir$()+"\Temp\ip.dll"
If File Exist(PATH$) Then Delete File PATH$ : Wait 1000
Else
FOLP$= Windir$()+"\Temp"
Make Directory FOLP$
Wait 1000
PATH$= FOLP$+"\ip.dll"
Endif
Copy File "media\ip_dll", PATH$
Load Dll PATH$,19
IP$ = Call Dll(19,"GetIp")
If File Exist(PATH$) Then Delete File PATH$
Delete Dll 19
If FOLP$ "" Then Delete Directory FOLP$
The more you see, the more you know.
The more you know, the more you see.