View previous topic :: View next topic |
Author |
Message |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Mon Dec 03, 2007 1:32 pm Post subject: [Delphi] Storing a DLL within a *.RES |
|
|
Hello everyone. I work with delphi.
I want to make a program which holds a DLL resource (not using it ... just simply storing it like an archive)
And whenever i press a buton on my form, this DLL to be extracted to the folder where is my Application.
I've looked some tutorials and examples how is it done but for some odd reason i can't figure out how is it done with extracting/saving it.
By the way i've compiled the res file with the dll in it with those arguements:
Code: | hack DLL "demoplayer.dll" |
Any working examples/code is appreciated.
Thank you all for even reading my request. Have a nice day!
_________________
|
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Dec 03, 2007 1:37 pm Post subject: |
|
|
FindResource, LoadResource, SizeofResource, LockResource, CreateFile, WriteFile, CloseHandle
_________________
|
|
Back to top |
|
 |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Mon Dec 03, 2007 1:51 pm Post subject: |
|
|
appalsap wrote: | FindResource, LoadResource, SizeofResource, LockResource, CreateFile, WriteFile, CloseHandle |
Those command are not helping me much.
Here is an example how we load BMP:
Code: | var bBitmap : TBitmap;
begin
bBitmap := TBitmap.Create;
try
bBitmap.Handle := LoadBitmap(hInstance, 'ATHENA');
Image1.Width := bBitmap.Width;
Image1.Height := bBitmap.Height;
Image1.Canvas.Draw(0,0,bBitmap);
finally
bBitmap.Free;
end;
end; |
Can't something similar to happen with my request of extracting the dll?
_________________
|
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Dec 03, 2007 1:53 pm Post subject: |
|
|
h4c0r-BG wrote: | Those command are not helping me much. |
That's the best I can give you without writing your code for you, which I don't want to do because there are many examples of this very thing on the forums.
_________________
|
|
Back to top |
|
 |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Mon Dec 03, 2007 2:11 pm Post subject: |
|
|
Okay ... the first line should look like this:
FindResource(hinstance, 'hack', RT_RCDATA);
I am asking do i need to use RT_RCDATA here or is it something else?
_________________
|
|
Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Dec 03, 2007 2:15 pm Post subject: |
|
|
no, use 'DLL' since that's what you put in your rc file
_________________
|
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Dec 03, 2007 2:30 pm Post subject: |
|
|
Code: |
var
ms:TResourceStream;
begin
ms:=TResourceStream.Create(hInstance,'hack','DLL');
ms.SaveToFile('c:\MyHack.dll'); |
|
|
Back to top |
|
 |
h4c0r-BG Master Cheater
Reputation: 0
Joined: 29 Nov 2006 Posts: 449 Location: The yogurt country
|
Posted: Mon Dec 03, 2007 2:39 pm Post subject: |
|
|
Thank you HolyBlah.
Too bad first I will have to rep somebody else if i want to rep you.
You mush change reputation of different member to be able to change reputation of the same member twice.
But don't worry.
_________________
|
|
Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Dec 03, 2007 2:57 pm Post subject: |
|
|
you can rep me
_________________
|
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Dec 03, 2007 2:58 pm Post subject: |
|
|
You dont have to +rep me...
|
|
Back to top |
|
 |
|