Running on XP. I have a client that calls calls CoInitializeEx(NULL, COINIT_MULTITHREADED)
, loads a (local) DCOM object, and attaches an event interface so the DCOM object can send back events. The client looks a lot like notepad with a multi-line textbox covering the client area to display event messages. Here are the calls that create a lock-up:
- Client calls
p->DoStuff()
on the DCOM object. - The DCOM object calls
c->DoStuffEvent()
on the client while processingDoStuff()
. - The client sends a
EM_REPLACESEL
message to the child textbox to have it display "stuff is happening"
The client freezes on the SendMessage(EM_REPLACESEL)
. The client's call to p->DoStuff()
is done on a the main thread while the SendMessage(EM_REPLACESEL)
is done on a different thread. I'm sure this has something to do with the problem.
Can someone explain what's causing the lock and how I might work around it? The client and DCOM objects are coded by me in MSVC/ATL, so I can modify them both as needed.