Re: PostMessage and C# multithread application - HOW IT REALLY WORKS
- From: "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
- Date: Tue, 1 Nov 2005 08:03:14 -0700
Not completely asynchronous, no. There's no good reason that I can think of
for doing that. The user interface is really a synchronous object, anyway.
If you have something that wants to happen in the background, use a thread,
but don't try to associate that with a window. Just have it do its job and
use an event or post a message to the main application, when the process is
done.
Paul T.
"Max" <spam@minimega@libero.it> wrote in message
news:e12jlSu3FHA.3260@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Paul,
> thanks for your reply. You give me a reason why, so I don't need to go
> over! In fact I've tried to make the window class instance in two
> separated threads, but the result is that I get no callback to the wndproc
> function! So, isn't possible to speak in an asyncronous way with two
> windows owned by the same application (exe) with the windows message way.
>
> Thanks,
> Massimo
>
> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
> ha scritto nel messaggio news:O35m9$j3FHA.2676@xxxxxxxxxxxxxxxxxxxxxxx
>> Sure, two windows in the same application do work synchronously to each
>> other. Read the code for any C/C++ Hello, World program. There's a
>> *single* message loop that calls GetMessage() to get the next message
>> from the *application message queue* and dispatch it to the right window.
>> I suppose that you could try to use threading to create two separate
>> message loops, but I'm not sure why you'd do this and there would be
>> numerous synchronization issues to be handled.
>>
>> Paul T.
>>
>
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: OpenNETCF SaveSetting / GetSetting
- Next by Date: Re: AutoScale not working
- Previous by thread: Re: PostMessage and C# multithread application - HOW IT REALLY WORKS
- Next by thread: Re: PostMessage and C# multithread application - HOW IT REALLY WORKS
- Index(es):
Relevant Pages
|