ATL Out of process EXE Question
-
Setup: I have a out of process COM exe which exposes a couple of objects Object A is created and has a connection point interface. On initialization Object A Creates a hidden window using the create function derived from CWindowImpl that listens for a custom message. Object A then creates a worker thread Worker thread does some stuff and sends a message to the hidden window to notify the original thread and have that thread fire an event on the com object Problem::mad: Nothing happens. The reason is that there is no message pump on the thread that contains Object A if it were and in process server the message pump for the client would work. I put a message pump after the thread spawn except it locks up the client since it is waiting for a return from the object creation. I tried to look at the ATL base classes to see if I could find how to add a message pump while still returning, but it was to no avail.
-
Setup: I have a out of process COM exe which exposes a couple of objects Object A is created and has a connection point interface. On initialization Object A Creates a hidden window using the create function derived from CWindowImpl that listens for a custom message. Object A then creates a worker thread Worker thread does some stuff and sends a message to the hidden window to notify the original thread and have that thread fire an event on the com object Problem::mad: Nothing happens. The reason is that there is no message pump on the thread that contains Object A if it were and in process server the message pump for the client would work. I put a message pump after the thread spawn except it locks up the client since it is waiting for a return from the object creation. I tried to look at the ATL base classes to see if I could find how to add a message pump while still returning, but it was to no avail.
You can't make outgoing COM calls in a handler for a sent message. Change it to a posted message and it should work. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ "Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain." -- Paul Watson, Linux Zombie