🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#14148
From: Remy Lebeau (TeamB)
Date: Sat, 30 Aug 2003 05:04
29 lines
1717 bytes
"Dumboo" <dumboo@nowhere.com> wrote in message
news:3f502081$1@newsgroups.borland.com...

> BYTE *MemPtr = (BYTE *)LockResource(MemoryHandle);
> std::auto_ptr<TMemoryStream>stream(new TMemoryStream);
> stream->Write(MemPtr, Size);
>
> // add this line
> stream->SaveToFile("filename");

Or, just write the data to a file directly without using a stream:

    BYTE *MemPtr = (BYTE *)LockResource(MemoryHandle);
    int iFile = FileCreate("filename");
    if( iFile != -1 )
    {
        FileWrite(MemPtr, Size);
        FileClose(iFile);
    }


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: <3f50304c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3f4e8776$1@newsgroups.borland.com> <3f502081$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-29 22:06:34 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f4e8776$1@newsgroups.borland.com> <3f502081$1@newsgroups.borland.com>
Subject: Re: How to save a zip-file FROM the resource...
Date: Fri, 29 Aug 2003 22:04:24 -0700
Lines: 31
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: <3f50304c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062219852 207.175.226.26 (29 Aug 2003 22:04:12 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail