Did you build that what you set up? :)
Printable View
Did you build that what you set up? :)
yes it built successfully
the GUI program i am trying to run is a visual basic program
yes and i got this error:Quote:
Did you test the Igor's sample?
[SC] StartService FAILED 2:
The system cannot find the file specified.
It only means you set a wrong path/name! Fix it!
the only line that has a path in it is this:
and that is the correct path to the exe file so i don't know where the problem isCode:CString path = GetExeFolderName() + TEXT("C:\\testService\\Debug\\testService.exe");
contents of what? i don't understandQuote:
What do you expect path to contain after this statement? Have you examined its contents?
The contents of path. Have you looked at it in the debuuger or shown it on screen to be sure it's what you are expecting as you are concatenating the result of GetExeFolderName() with the TEXT string? As the TEXT string contains both a drive letter and folder names I'm not sure what you are trying to achieve by concatenating this TEXT string with the result of GetExeFolderName().
ok so i entered the wrong path name?
if GetExeFolderName() gets the folder, then the path should just be testService.exe?
Have you checked what GetExeFolderName is actually returning? As you are hardcoding the full path to your testservice.exe, you probably don't need GetExeFolderName at all at the moment whilst you are testing.
this is the code for GetExeFolderName
so if i don't need that should i just call the path like this:Code:CString GetExeFolderName()
{
TCHAR path[MAX_PATH] = {0};
GetModuleFileName(GetModuleHandle(NULL), path, MAX_PATH);
LPTSTR p = _tcsrchr(path, _T('\\'));
if (p)
{
*p = TEXT('\0');
return path;
}
return (LPCTSTR)NULL;
}
CString path = TEXT("C:\\testService\\Debug\\testService.exe");
Yes. What debugging of the program have you done - as this should have been picked up by using the debugger.Quote:
so if i don't need that should i just call the path like this:
CString path = TEXT("C:\\testService\\Debug\\testService.exe");
can't debug a service program and i can't test the service because of this error
the service installed fine but it won't start