Re: CEvent instance shared between apps ?
- From: Phil <pbruyant@xxxxxxxxx>
- Date: Tue, 6 May 2008 05:01:30 -0700 (PDT)
On 6 mai, 13:39, ChrisN <chrisn...@xxxxxxxxxxxxxxxxxxxxx> wrote:
On Tue, 6 May 2008 02:01:31 -0700 (PDT), Phil <pbruy...@xxxxxxxxx>
wrote:
This works great, except when I run multiple instances of my
application on the same
computer. When I click the "Stop" button of one app to exit its
thread, the other threads created by the
other applications stop too! I would not expect the CEvent object
being shared by the apps!
What did I do wrong?
I also declared the controlling function as a static member of
MyAppDlg, with the same result :(
You'll get the behaviour you describe if you specified a name for the
event object when it was constructed:
CEvent Event( FALSE, FALSE, _T( "MyEvent" ), NULL );
This creates an event that is shared between processes.
To ensure that the event is unique to each process, specify NULL for
the lpszName parameter:
CEvent Event( FALSE, FALSE, NULL, NULL );
Chris
Thank you so much Chris !
Indeed, I had named my events. Specifying NULL for the names solved
the problem.
Thanks again !
Phil
.
- Follow-Ups:
- Re: CEvent instance shared between apps ?
- From: Joseph M . Newcomer
- Re: CEvent instance shared between apps ?
- References:
- CEvent instance shared between apps ?
- From: Phil
- Re: CEvent instance shared between apps ?
- From: ChrisN
- CEvent instance shared between apps ?
- Prev by Date: Re: CEvent instance shared between apps ?
- Next by Date: Re: MDAC memory leak
- Previous by thread: Re: CEvent instance shared between apps ?
- Next by thread: Re: CEvent instance shared between apps ?
- Index(es):