Article View: borland.public.cppbuilder.nativeapi
Article #14141Re: How to save a zip-file FROM the resource...
From: Remy Lebeau (TeamB)
Date: Fri, 29 Aug 2003 00:04
Date: Fri, 29 Aug 2003 00:04
32 lines
2317 bytes
2317 bytes
"Oren (Halvani.de)" <neroniker@gmx.de> wrote in message news:3f4e8776$1@newsgroups.borland.com... > I got a .exe file in my programm that I nead to save FROM the resource.. > the problem is how can I do that ?? Store the zip file as an RCDATA resource. Then you can use the FindResource(), LoadResource(), and LockResource() functions to gain access to the actual data for the file. Once you have access to the data, yu can do whatever you want with it. > 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 ?? That example already shows you everything you need to know. If you go look at the documentation for TMemoryStream, you'll see that it has a SaveToFile() method. The alternative is to not use TMemoryStream, but just write the data directly to file manually using either a TFileStream, the VCL functions FileCreate() and FileWrite(), or the Win32 API functions CreateFile() and WriteFile(). Gambit --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03
Technical Details
Message-ID:
<3f4e9887$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!12.120.28.37.MISMATCH!attla2!ip.att.net!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f4e8776$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,f1923e03d3dce476 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-28 17:09:28 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f4e8776$1@newsgroups.borland.com> Subject: Re: How to save a zip-file FROM the resource... Date: Thu, 28 Aug 2003 17:04:30 -0700 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f4e9887$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062115463 207.175.226.26 (28 Aug 2003 17:04:23 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!12.120.28.37.MISMATCH!attla2!ip.att.net!in.100proofnews.com!in.100proofnews.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail