🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Modal dialog in main thread causes file io in another to fail

#5642
From: Pontius
Date: Tue, 26 Jul 2005 18:05
31 lines
2164 bytes
It fails because CreateFile returns a handle == INVALID_HANDLE_VALUE.

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. Even if I don't open a file, and just select cancel, the call to CreateFile() in the thread in the second form fails.

Any thoughts?

"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Pontius" <mfbscs@mchsi.com> wrote in message
>news:42dea200$1@newsgroups.borland.com...
>
>> This works fine, except if I happen to open a modal dialog in the
>> main form, like a FileOpenDialog for example. If it's open while
>> the thread in the second form makes the call to CreateFile(), then
>> CreateFile() will fail.
>
>Fail how exactly?  What error does it report?  My guess would be that the
>dialog is operating on the same file that the thread is trying to access,
>and the dialog is not setting sharing attributes on the file when opening
>it.
>
>> Is there any documentation that says having a modal dialog open
>> will cause all file IO in all other threads to fail? I've never seen any.
>
>Modal dialogs in general do not have any effect on file I/O.
>
>
>Gambit
>
>
Technical Details
Message-ID: <42e67b74$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42dea200$1@newsgroups.borland.com> <42deaeb1$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: "Pontius" <mfbscs@mchsi.com>
Sender: "Pontius" <mfbscs@mchsi.com>
Reply-To: "Pontius" <mfbscs@mchsi.com>
Subject: Re: Modal dialog in main thread causes file io in another to fail
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 138.163.0.41     
References: <42dea200$1@newsgroups.borland.com> <42deaeb1$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42e67b74$1@newsgroups.borland.com>
Date: 26 Jul 2005 11:05:40 -0700
X-Trace: newsgroups.borland.com 1122401140 207.105.83.66 (26 Jul 2005 11:05:40 -0700)
Lines: 32
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!bandi.nntp.kabelfoon.nl!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail