Extracting a Dll from Exe...

Hi:
I need include a Dll in my EXE and extract the DLL in Run-Time and load it in memory. How I can Do this?
              Thanks
fantasma110899Asked:
Who is Participating?
 
bogieman_Connect With a Mentor Commented:
You need to compile a resource file with brcc32.exe and include it in you r exe: enter this in a text file and name it with a .rc extension

MyDll DLL c:\MyDll.dll

then in dos, go to the delphi/bin directory and type brcc32 c:\MyResfile.rc - which will compile it as a res file.  Then, somewhere in your delphi project file, add {$R MyResFile.res} which will include the res file in your compiled exe.

To extract it:

var
Dll:tresourcestream;
begin
dll:=tresourcestream.create(hinstance,'DLL','MyDll');

and if you want to save it temporarily, just do dll.savetofile(...);

I have just typed this off the top of my head, so if it doesn't work, tell me
0
 
fantasma110899Author Commented:
All is Ok with the resource load but How I can get a handle to the Dll without saving it to a file? I need this to uses GetProcAddress.
0
 
intheCommented:
you must save to file first then you can get the handle.
0
 
fantasma110899Author Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.