CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2003
    Location
    INDIA
    Posts
    586

    Multiple instances of NT service

    Hi guys, any idea about how to configure/code so as to run multiple instances of NT service. If any of you have access to Oracle or SQL server 2005, open service manager (start -> run ->services.msc) , check the oracle database instance or sql server instance. They call the same binary file i.e. Oracle.exe passing database name as argument.

    I mean exactly that. I have a NT service which is registered first time using myservicename /service. I now want to have multiple instances of it registered and run i.e. myservicename_1, myservicename_2 etc. Any idea on how to do that?

    Thanks.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Multiple instances of NT service

    Did you try registering them multiple times with different register names ?

  3. #3
    Join Date
    Jun 2003
    Location
    INDIA
    Posts
    586

    Re: Multiple instances of NT service

    Skizmo, what do you mean by registering them multiple times with multiple names? Mines is an service written using ATL. When I ask it to register (by passing the switch /service or /regserver), it loads the resource compiled into it and updates the registry.

    How can you register using a different name? A service is a self registering component.

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Multiple instances of NT service

    Oops. . I guess I was sleeping when I read your post. I wrote some services myself and registered them from my own code with the function CreateService. With this function you can give your service every name you want, and register the same service with different names.

  5. #5
    Join Date
    Jun 2003
    Location
    INDIA
    Posts
    586

    Re: Multiple instances of NT service

    Skizmo, thanks for your pointer. I was able to do this using my own startup code calling CreateService. Thanks again.
    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured