Article View: borland.public.cppbuilder.nativeapi
Article #2001Re: Error handling Flash Card Reader?
From: Mark Jacobs
Date: Thu, 03 May 2007 18:19
Date: Thu, 03 May 2007 18:19
18 lines
1563 bytes
1563 bytes
"Bob Reeves" <bob@somethinxtra.com> wrote in message
news:4638ae13$1@newsgroups.borland.com...
> Here is what I am trying to do, please assume all variables have been
> declared and initialized..
> old_err_mode = SetErrorMode(SEM_FAILCRITICALERRORS);
> SetLastError(-1);
> dn = findfirst(FileName,&ffblk,0); // find first file
> er = GetLastError();
> if(er != -1) {
> FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, er, 0, buffer,
> sizeof(buffer), 0);
> <SNIP>
Try changing if(er != -1) to if(er != -1 && dn !=0)
dn is non-zero if it didn't find anything.
--
Mark Jacobs
www.jacobsm.com
Technical Details
Message-ID:
<463a27a6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4638ae13$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,189da4c7c99990ac X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mark Jacobs" <mark@jacobsm.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4638ae13$1@newsgroups.borland.com> Subject: Re: Error handling Flash Card Reader? Date: Thu, 3 May 2007 19:19:20 +0100 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 195.137.123.182 Message-ID: <463a27a6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1178216358 195.137.123.182 (3 May 2007 11:19:18 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail