Click to See Complete Forum and Search --> : ATL service thread message pump


George Cristea
March 31st, 1999, 08:20 AM
I have created a service with ATL Wizard. In the

"void CServiceModule::Run()" function I found the code


while (GetMessage(&msg, 0, 0, 0))

DispatchMessage(&msg);


My question is: where are messages from "DispatchMessage(&msg)" processed?


Thanx a lot!

Robert Dobbins
April 6th, 1999, 12:58 PM
If your object is running in a STA then all calls to its methods will go through the Message loop. Read up on STA Stuff.

Anil A Elson
April 8th, 1999, 08:49 AM
Hi,

When you call CoInitialize or CoInitailizeEx with apartment model threading the COM Subsystem will
create an Invisible Window with class name "OleMainThreadWndClass". it will use this window to
recieve client requests. this is the simplest expaination, if you need more details refer to any book
which explains COM threading models and proxy implementation

Regards,
Anil