CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    Chennai, India
    Posts
    76

    Passing Parameters to ServiceMain Function

    HI,
    I need to pass parametes to service main function.

    This is how define the Service startup function
    SERVICE_TABLE_ENTRY serviceTable[] =
    {
    { SZSERVICENAME, (LPSERVICE_MAIN_FUNCTION) ServiceMain},
    { NULL, NULL}
    };


    I am using the follwing command to start the service.
    success = StartServiceCtrlDispatcher(serviceTable);


    1. If i want to parameters to the service main function, how can i do that.
    2. Is there a way i can find the name of the service that i am starting before calling serice main function.
    This is because i have installed the service using the fuction CreateService(), in which we give the name of the exe that we want to start when the service is started. In this executable before serice main is getting called the statically lined dll's are getting involked. I need to use the service name in the DllMain function of these function.

    3. Is there a way when i create the serice using CreateService(), i can pass the command line parameters to the function to it, so that when i start the serice i can use these command line parameters.


    Thanks in Advance,
    Varadha

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following thread...

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