Article View: borland.public.cppbuilder.nativeapi
Article #14420Re: FileCreate function problem
From: Martin C
Date: Wed, 13 Aug 2003 11:48
Date: Wed, 13 Aug 2003 11:48
59 lines
3405 bytes
3405 bytes
Well Mr. Jonathon, thanks for the advices
1- BTW for my typing mistake I am a HUMAN, so POP News human do mistakes...
2- I pasted the code as is I was using it, I have no intention to hide my
code in here...
3- All I said I am doing something wrong and I need help, I didn't say I am
a master and fooling people.
Once again thanks for the advices...
"Jonathan Arnold" <jdarnold@buddydog.org> wrote in message
news:3f3a343e$1@newsgroups.borland.com...
> Plese follow newsgroup guidelines and avoid overquoting. Just
> include the lines you need to give your reply context.
>
> http://www.borland.com/newsgroups/ - Borland newsgroup descriptions
> http://www.borland.com/newsgroups/netiquette.html - netiquette
>
> BTW, here's a good page that describes the "evils" of top-posting:
>
> http://www.caliburn.nl/topposting.html
>
> >>>>> if(!FileExists("c:\CProjects\test.txt"))
> >>>>> {
> >>>>> if(!FileCreate("c:\CProjects\test.txt"))
> >>>>> {
> >>>>> TStringList *Sample1 = new TStringList();
> >>>>> Sample1->LoadFromFile("c:\CProjects\test.txt"); // Error
> >>>>> }
> >>>>> }
> >>>>>
>
> This code is just all wrong:
>
> 1 - As pointed out earlier, you need to double up on the slashes. You said
> it was a mistype - please just copy and paste your code in the future to
> be sure we're all working on the same problem:-)
>
> 2 - FileExists returns false if the file doesn't exist. You say you see
> it in Explorer after running, so you know it exists. Have you deleted it
> first, before running? Because otherwise this code will never run.
>
> 3 - FileCreate returns a -1 on error, and a positive value if it succeeds.
> So your test should be : if ( FileCreate(...) != -1 ). Be sure to read
> the docs before using an API call.
>
> 4 - You mention your receive an error about not being able to open
'test.tct'
> (sic). Again, we need to get the *exact* code you are using. Maybe you
simply
> have a typo?
>
> --
> Jonathan Arnold C/C++/CBuilder Keen Advice:
> http://www.keen.com/categories/categorylist_expand.asp?sid=5156620
> Comprehensive C++Builder link site:
> http://www.buddydog.org/C++Builder/c++builder.html
>
Technical Details
Message-ID:
<3f3a3802@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!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<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>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 06:12:02 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> Subject: Re: FileCreate function problem Date: Wed, 13 Aug 2003 03:48:04 -0800 Lines: 61 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.27.112 Message-ID: <3f3a3802@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060780034 62.135.27.112 (13 Aug 2003 06:07:14 -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!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail