Asked By Tim Roberts
18-Feb-08 11:12 PM
When you call CreateWindow, that window is "owned" by the thread that
created it, and messages for that window will be sent into the message
queue for that thread. The normal message loop, which runs in the main
thread, will never see them. In fact, if that second thread doesn't start
a message loop, the messages will never be processed.
That's why you read so many articles warning about combining GUI operations
with multithreading.
Now, if you know the DLL isn't going to create any windows, then it would
be fine to call it from a second thread. I just presented one possible
counterexample.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.