Quick question on message loop in ATL service 
Author Message
 Quick question on message loop in ATL service

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



Wed, 21 Jan 2004 20:29:09 GMT  
 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



Sat, 24 Jan 2004 03:44:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ATL Service service could not be deleted message???

2. Quick do...while loop question

3. Quick question on services and output to stdout

4. quick question in atl linker error involving __IID_DEFINED__

5. Quick question on custom error messages w/ Error() macro

6. 2 quick Windows message questions

7. Quick Framework Question / Notify messages

8. vc++ event loop / message pump question

9. Question: How to keep processing messages in a loop

10. Quick Question, Quick Answer

11. Delete the WM_KEYDOWN message before into the message Loop of WinMain

12. User defined messages and the message loop

 

 
Powered by phpBB® Forum Software