message pump code for COM STA

Joined
Feb 12, 2008
Messages
108
Reaction score
0
Hello everyone,


1.

For message pump code for COM STA, my question is, we just need to copy and past the following code to STA owner thread, no need to implement any functions to handle msg (e.g. hidden window message handler)?

(I think no need and I think COM Runtime will plug-in a message handler for the hidden window, to process the msg and call related function automatically?)

Code:
MSG msg;
while (GetMessage (&msg, 0, 0, 0))
 DispatchMessage (&msg);

2.

If all the message pump code are common, why not COM automatically generates the code for all STA? Because some STA has the requirement of not handling in-coming calls from other apartment?


thanks in advance,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top