Is it possible to include external DLLs similar to image files (see command IncludeBinary ) ?
I only want to deliver my program as a single file and images / external libraries should be included.
Thx!
Is it possible to include DLLs ?
Re: Is it possible to include DLLs ?
Yes, you can include every type of you want to. You need to copy the included DLL to a temporary directory or you can load it from memory (there's code for that somewhere here, I just don't know where).
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Is it possible to include DLLs ?
I typically do it with a DataSection and IncludeBinary, extracting to %TEMP%. For me it was an updater executable, not a DLL, but my code worked like:
THen in my data section, I have:
HTH
Code: Select all
Temp$ = GetEnvironmentVariable("TEMP")
FileID = CreateFile(#PB_Any, Temp$ + #PS$ + "Updater.exe")
If Not FileID
; ...
EndIf
WriteData(FileID, ?Updater, ?EndUpdater - ?Updater)
CloseFile(FileID)
RunProgram(Temp$ + #PS$ + "Updater.exe", "", GetCurrentDirectory())
Code: Select all
Updater:
IncludeBinary "Updater.exe"
EndUpdater:
Re: Is it possible to include DLLs ?
... ok, thanks for the example. I don't want to copy the file (DLL) to a temp directory. So I I'm looking for an example to load the dll directly into memory ...
Re: Is it possible to include DLLs ?
have a look at:
HTH
PureBasic: Surprisingly simple, diabolically powerful


