Question about ATL services, where to put user code 
Author Message
 Question about ATL services, where to put user code

I'm new to ATL services, or even NT Services in general.  Just playing at
this point.

I went through the ATL Appwizard and created a basic service, and now I'm
trying to figure out how to make it load up a COM component from a DLL,
retrieve an interface pointer and call a method on it.  Is the ideal place
for doing something like this in the CServiceModule's Run() method?
Start(), perhaps?   Like I said, I'm new at this

Maybe in the Handler() function, but from what I see in there it looks like
it's designed for handling Service Control messages and that I shouldn't use
it myself.

Likewise, I would like to shut the server down after I successfully call my
method, and wondered if I should somehow try to post a SERVICE_CONTROL_STOP
message?

I'm sure these are all basic questions, and all I'm interested in doing at
this point is some pretty basic ATL service programming, so if there are any
quick tutorials on the web that might help me, that would be great.
Gracias..

Robert ("Buckminster") Gambles



Wed, 21 Jul 2004 03:49:32 GMT  
 Question about ATL services, where to put user code
I'd recommend a book here:
"Professional NT Services" by Kevin Miller, Wrox Press

Just a note, ATL COM services are for hosting COM objects - servers.
You are talking about client-side code. Are you sure you want a
service? Even if you do, a service created with ATL is designed to
host COM objects. If you need a general purpose NT service, you
are better off not using the ATL appwizard... The book should
clear this up for you.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I'm new to ATL services, or even NT Services in general.  Just playing at
> this point.

> I went through the ATL Appwizard and created a basic service, and now I'm
> trying to figure out how to make it load up a COM component from a DLL,
> retrieve an interface pointer and call a method on it.  Is the ideal place
> for doing something like this in the CServiceModule's Run() method?
> Start(), perhaps?   Like I said, I'm new at this

> Maybe in the Handler() function, but from what I see in there it looks like
> it's designed for handling Service Control messages and that I shouldn't use
> it myself.

> Likewise, I would like to shut the server down after I successfully call my
> method, and wondered if I should somehow try to post a SERVICE_CONTROL_STOP
> message?

> I'm sure these are all basic questions, and all I'm interested in doing at
> this point is some pretty basic ATL service programming, so if there are any
> quick tutorials on the web that might help me, that would be great.
> Gracias..

> Robert ("Buckminster") Gambles



Wed, 21 Jul 2004 06:33:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ATL Service: only one user with write rights

2. ATL 7.0 Windows Service generated code

3. Fix COM service code generated by ATL AppWizard?

4. Simple Question About ATL Service Wizard?

5. Simple ATL 7.0 Service question

6. ATL 7.0 NT Service question...

7. question for ATL Service

8. ATL Service and ADO Question...

9. Quick question on message loop in ATL service

10. ATL service questions...

11. ATL service - amateur question

12. Additional ATL service question

 

 
Powered by phpBB® Forum Software