ATL 7.0 NT Service question... 
Author Message
 ATL 7.0 NT Service question...

I'm trying to convert an old NT service to the new attributed format in VC
The service instantiates a COM object which uses Winsock to open several
TCP connections.  I also have a timer running. This runs fine in the
but when I run it as a service I don't get any WinSock events or timer

I'm starting from scratch and new to the VC 7.0 model of services.

Can anyone tell me what I'm missing?  I'm sure it's something obvious
to anyone knowledgeable, but I can't find any examples of attributed
services from MS.

One other question...
I was able to make my old service run as multiple instances, each using
a separate configuration, but it was awkward.  Is there a proper way to do

The following is the simplest example of code that works in the IDE but not
as a service:

[ module(SERVICE, uuid = "{99CCA443-725A-44F2-A5F3-9855AFACF970}",
name = "QService",
helpstring = "QService 1.0 Type Library",
resource_name="IDS_SERVICENAME") ]
class CQServiceModule
    CQServiceModule() {};

    HRESULT PreMessageLoop(int nShowCmd)
        HRESULT hr = __super::PreMessageLoop(nShowCmd);
        if ( SUCCEEDED(hr) )
            return S_OK;
        return hr;

    HRESULT Start(int nCmd)
        m_lTimer = ::SetTimer((HWND) NULL, 1, 10000, TimerProc);
        return __super::Start(nCmd);

    static void CALLBACK TimerProc(HWND hwnd,UINT uMsg, UINT idEvent, DWORD
        LogEvent(_T("Timer hit"));

    UINT m_lTimer;


Thanks in advance,


Mon, 23 Aug 2004 00:12:23 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ATL 7.0 NT Service problem?

2. Simple ATL 7.0 Service question

3. Problem with ATL Service with ATL 7.0

4. ATL NT service question

5. ATL 7.0 Windows Service generated code

6. Problem with ATL 7.0 service (HELP!)

7. ATL 7.0 Beta 2 Service Bomb

8. Remote startup of NT Services from another NT Service

9. HELP - ATL NT Service and COM Interface Problem

10. Q .atl win nt service

11. Accessing an ATL obj in ROT from NT Service

12. Writing ATL NT Service


Powered by phpBB® Forum Software