Article View: borland.public.cppbuilder.nativeapi
Article #5644Re: Modal dialog in main thread causes file io in another to fail
From: Remy Lebeau (TeamB)
Date: Tue, 26 Jul 2005 18:58
Date: Tue, 26 Jul 2005 18:58
28 lines
2061 bytes
2061 bytes
"Pontius" <mfbscs@mchsi.com> wrote in message news:42e67b74$1@newsgroups.borland.com... > It fails because CreateFile returns a handle == INVALID_HANDLE_VALUE. What does GetLastError() return when CreateFile() fails? GetLastError() tells you WHY it failed. > I am not opening the file that is being operated on. All that matters > is that I have the dialog box open in the first form. Did you read what I said about that earlier? The dialog probably has the file locked at the time. > Even if I don't open a file, and just select cancel, the call to > CreateFile() in the thread in the second form fails. I seriously doubt that. Even if the dialog did lock the file, it would unlock it when the dialog is closed. The only other possibility is that you don't have security access to the file in the first place. If that is the case, then it doesn't matter whether the dialog is opened or not, the CreateFile() wil always fail unless you adjust the security rights on the file itself. Gambit
Technical Details
Message-ID:
<42e68a38$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42dea200$1@newsgroups.borland.com> <42deaeb1$1@newsgroups.borland.com> <42e67b74$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ea5ae54620c4626a X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42dea200$1@newsgroups.borland.com> <42deaeb1$1@newsgroups.borland.com> <42e67b74$1@newsgroups.borland.com> Subject: Re: Modal dialog in main thread causes file io in another to fail Date: Tue, 26 Jul 2005 11:58:49 -0700 Lines: 30 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42e68a38$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1122404920 68.69.17.41 (26 Jul 2005 12:08:40 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail