views:

439

answers:

2

Is there any way to know whether a MFC message loop is already running?

EDIT: Context: A library (with event handling) needs to know whether its event filtering has to attach to an existing MFC message loop or create its own message loop: in case a main message loop already exists it must not create its own loop because it would be blocking.

A: 

In what situation? What are you trying to do?

Joel
A: 

There is no way to do it without waiting some time, for instance while trying to send an event and wait for it, or wait 5 sec using a special MFC function which is dedicated to detect stalled applications (which one? I can't remember its name...).

If you need to do it, find another way, make other assumptions. Sorry.

moala