
Quick question on message loop in ATL service
Depends on the COM threading model you use. The wizard defaults
(very badly) to STA so all incoming calls are served on the service
thread via the message loop. One of the first tasks in an ATL service
is to switch the threading model to MTA (see the comments in the
code). Of course your objects must be designed for MTA...
I suggest you reading the book "Professional NT Services" by Kevin
Miller, Wrox Press. He dedicates a chapter on fixing the mess the
ATL service appwizard creates...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Quote:
> Hi,
> Just to clarify something I've always thought...
> If I create an service using ATL and this service
> houses several COM components which are registered
> when the service starts, are calls to these components
> processed through the message loop that is spun
> just after the service is started? Is the message
> loop needed for any other reason?
> Cheers,
> Akin