🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: FileCreate function problem

#14433
From: Martin C
Date: Wed, 13 Aug 2003 21:56
28 lines
1978 bytes
Thank you paul so much, that is exactly what I was missing, it worked more
than fine..

Once again thanks for your help...

Regards

<Paul> wrote in message news:3f3a4507$1@newsgroups.borland.com...
> The reason it's not working, is FileCreate returns the file handle. Then
you
> are trying to access it without relasing this handle. Try the following:
>
>   if(!FileExists("c:\\CProjects\\test.txt"))
>   {
>     int i = FileCreate("c:\\CProjects\\test.txt");
>     if( i != -1 )
>     {
>       FileClose( i );
>       TStringList *Sample1 = new TStringList();
>       Sample1->LoadFromFile("c:\\CProjects\\test.txt");
>     }
>   }
>
> Hope this helps.
>
> Paul.
>
>
Technical Details
Message-ID: <3f3ac69a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!wn14feed!wn13feed!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
References: <3f3989ee@newsgroups.borland.com> <3f398d1f$1@newsgroups.borland.com> <3f398d79@newsgroups.borland.com> <3f39f7a6$1@newsgroups.borland.com> <3f3a1241@newsgroups.borland.com> <3f3a343e$1@newsgroups.borland.com> <3f3a3802@newsgroups.borland.com> <3f3a4507$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5967b7894a1d3380
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-13 16:20:44 PST
From: "Martin C" <martinc@aol.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f3989ee@newsgroups.borland.com> <3f398d1f$1@newsgroups.borland.com> <3f398d79@newsgroups.borland.com> <3f39f7a6$1@newsgroups.borland.com> <3f3a1241@newsgroups.borland.com> <3f3a343e$1@newsgroups.borland.com> <3f3a3802@newsgroups.borland.com> <3f3a4507$1@newsgroups.borland.com>
Subject: Re: FileCreate function problem
Date: Wed, 13 Aug 2003 13:56:30 -0800
Lines: 30
Organization: V Safe
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.1165
NNTP-Posting-Host: 62.135.6.232
Message-ID: <3f3ac69a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1060816538 62.135.6.232 (13 Aug 2003 16:15:38 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-09!supernews.com!wn14feed!wn13feed!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