Click here to Skip to main content
15,910,773 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: extern usage problem Pin
linux_xjtu25-Apr-09 0:23
linux_xjtu25-Apr-09 0:23 
QuestionHow to determine if the current window is the desktop ? Pin
Yovav24-Apr-09 23:10
Yovav24-Apr-09 23:10 
AnswerRe: How to determine if the current window is the desktop ? Pin
Hamid_RT24-Apr-09 23:26
Hamid_RT24-Apr-09 23:26 
GeneralRe: How to determine if the current window is the desktop ? Pin
Yovav25-Apr-09 0:23
Yovav25-Apr-09 0:23 
QuestionHow to set focus on the next window after minimizing ? Pin
Yovav24-Apr-09 22:32
Yovav24-Apr-09 22:32 
AnswerRe: How to set focus on the next window after minimizing ? [modified] Pin
Yovav24-Apr-09 22:55
Yovav24-Apr-09 22:55 
QuestionMicrosoft Soap tool Kit compatible with all the versions of mssoap.dll Pin
Member 401661624-Apr-09 22:13
Member 401661624-Apr-09 22:13 
QuestionService not started. Pin
Le@rner24-Apr-09 21:39
Le@rner24-Apr-09 21:39 
Hi all,

i have created a service like this.its created successfully,but not started.

#define SVCNAME TEXT("Test_Service_Name")

SC_HANDLE schSCManager;
    SC_HANDLE schService;
    TCHAR szPath[MAX_PATH];

    if( !GetModuleFileName( NULL, szPath, MAX_PATH ) )
    {
        printf("Cannot install service (%d)\n", GetLastError());
        return;
    }

    // Get a handle to the SCM database. 
 
    schSCManager = OpenSCManager( 
        NULL,                    // local computer
        NULL,                    // ServicesActive database 
        SC_MANAGER_ALL_ACCESS);  // full access rights 
 
    if (NULL == schSCManager) 
    {
        printf("OpenSCManager failed (%d)\n", GetLastError());
        return;
    }

    // Create the service.

    schService = CreateService( 
        schSCManager,              // SCM database 
        SVCNAME,                   // name of service 
        SVCNAME,                   // service name to display 
        SERVICE_ALL_ACCESS,        // desired access 
        SERVICE_WIN32_OWN_PROCESS, // service type 
        SERVICE_DEMAND_START,      // start type 
        SERVICE_ERROR_NORMAL,      // error control type 
        szPath,                    // path to service's binary 
        NULL,                      // no load ordering group 
        NULL,                      // no tag identifier 
        NULL,                      // no dependencies 
        NULL,                      // LocalSystem account 
        NULL);                     // no password 
 
    if (schService == NULL) 
    {
        printf("CreateService failed (%d)\n", GetLastError()); 
        CloseServiceHandle(schSCManager);
        return;
    }
    else printf("Service installed successfully\n"); 

    CloseServiceHandle(schService); 
    CloseServiceHandle(schSCManager);


please tell me how can i start a service.

or tell me how can i call another application from created service.

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: Service not started. Pin
Hamid_RT24-Apr-09 22:52
Hamid_RT24-Apr-09 22:52 
GeneralRe: Service not started. Pin
Le@rner24-Apr-09 23:05
Le@rner24-Apr-09 23:05 
GeneralRe: Service not started. Pin
Hamid_RT24-Apr-09 23:27
Hamid_RT24-Apr-09 23:27 
GeneralRe: Service not started. Pin
Le@rner24-Apr-09 23:54
Le@rner24-Apr-09 23:54 
GeneralRe: Service not started. Pin
Hamid_RT25-Apr-09 0:33
Hamid_RT25-Apr-09 0:33 
QuestionHow to send an Email Pin
AnithaSubramani24-Apr-09 21:02
AnithaSubramani24-Apr-09 21:02 
AnswerRe: How to send an Email Pin
CPallini24-Apr-09 22:02
mveCPallini24-Apr-09 22:02 
AnswerRe: How to send an Email Pin
Hamid_RT24-Apr-09 22:48
Hamid_RT24-Apr-09 22:48 
QuestionPdf Creation Pin
AnithaSubramani24-Apr-09 20:56
AnithaSubramani24-Apr-09 20:56 
QuestionRe: Pdf Creation Pin
CPallini24-Apr-09 22:01
mveCPallini24-Apr-09 22:01 
AnswerRe: Pdf Creation Pin
Code-o-mat24-Apr-09 22:13
Code-o-mat24-Apr-09 22:13 
AnswerRe: Pdf Creation Pin
Hamid_RT24-Apr-09 22:57
Hamid_RT24-Apr-09 22:57 
AnswerRe: Pdf Creation Pin
bob1697225-Apr-09 4:44
bob1697225-Apr-09 4:44 
QuestionProcess is not getting attached Pin
pandit8424-Apr-09 20:09
pandit8424-Apr-09 20:09 
AnswerRe: Process is not getting attached Pin
Baltoro25-Apr-09 8:27
Baltoro25-Apr-09 8:27 
QuestionFinally I got one solution ! But still some problem exists !!! Pin
kapardhi24-Apr-09 19:25
kapardhi24-Apr-09 19:25 
Questionwarning C4244: 'argument' : conversion from 'INT_PTR' to 'int', possible loss of data [modified] Pin
vibindia24-Apr-09 19:23
vibindia24-Apr-09 19:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.