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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bogieman_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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.