🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14140

How to save a zip-file FROM the resource...

#14140
From: Oren (Halvani.de)
Date: Thu, 28 Aug 2003 22:51
32 lines
2015 bytes
hi dear builders,

one question..

I got a .exe file in my programm that I nead to save FROM the resource..
the problem is how can I do that ??

here is a sample I found on: http://www.bcbdev.com/faqs/faq90.htm

the problem, it descibs only how to LOAD the resource...but I need
to save it to the harddisk...so how do I make it ??

Oren

/************************************************/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    // Find the resource using the resource ID from resource.rh
    HRSRC rsrc = FindResource(HInstance,
MAKEINTRESOURCE(ID_MY_EXE),RT_RCDATA);
    if(!rsrc)
        return;

    // Load the resource and save its total size. We will need the size
    // when we read the data.
    DWORD Size = SizeofResource(HInstance , rsrc);
    HGLOBAL MemoryHandle = LoadResource(HInstance,rsrc);
    if(MemoryHandle == NULL)
        return;

   // Save to C:\Tools\MyExe.exe
}
Technical Details
Message-ID: <3f4e8776$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!wn14feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f1923e03d3dce476,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-28 16:01:24 PST
From: "Oren \(Halvani.de\)" <neroniker@gmx.de>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to save a zip-file FROM the resource...
Date: Fri, 29 Aug 2003 00:51:07 +0200
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 213.6.46.126
Message-ID: <3f4e8776$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062111094 213.6.46.126 (28 Aug 2003 15:51:34 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!wn14feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail