Article View: borland.public.cppbuilder.nativeapi
Article #16488Re: Help with Mapping a file into memory
From: Sam Mildener
Date: Sat, 10 May 2003 16:11
Date: Sat, 10 May 2003 16:11
22 lines
2061 bytes
2061 bytes
Ray wrote: > Hi All > > I wish to map a simple data file (ascii text file in essence) into > memory in my application so that subsequent calls to that file use > the data in memory instead of reopening the file. I presume that this > will be faster for large files (although Windows file caching may > mean that I am mistaken about this). > > Have had a look at CreateFileMapping() and MapViewofFile() in the API > Help but I find them a little confusing especially as there are no > examples that show the usage of the data in the way I want. > > Can anyone point me to a source of more information and or examples, > or could anyone kindly give an example of what I am trying to achieve. Here's an example of a class that wraps up all the code: http://www.microsoft.com/msj/0498/hoodtextfigs.htm#fig4 -- Sam Mildener
Technical Details
Message-ID:
<Fw9va.2023$nY4.431373453@hestia.telenet-ops.be>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!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.kabelfoon.nl!212.113.2.136.MISMATCH!newsfeed.london1.eu.level3.net!level3eu!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mailReferences:
<3ebd068b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,54763ae38339041 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-10 09:17:21 PST 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!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.kabelfoon.nl!212.113.2.136.MISMATCH!newsfeed.london1.eu.level3.net!level3eu!ossa.telenet-ops.be!hestia.telenet-ops.be.POSTED!not-for-mail From: "Sam Mildener" <nospam@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebd068b@newsgroups.borland.com> Subject: Re: Help with Mapping a file into memory Lines: 24 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 Message-ID: <Fw9va.2023$nY4.431373453@hestia.telenet-ops.be> Date: Sat, 10 May 2003 16:11:17 GMT NNTP-Posting-Host: 81.82.97.144 X-Complaints-To: abuse@telenet.be X-Trace: hestia.telenet-ops.be 1052583077 81.82.97.144 (Sat, 10 May 2003 18:11:17 CEST) NNTP-Posting-Date: Sat, 10 May 2003 18:11:17 CEST Organization: Telenet Internet