-
April 29th, 2013, 11:38 AM
#46
Re: running a GUI program in the background
Did you build that what you set up?
Best regards,
Igor
-
April 30th, 2013, 02:59 AM
#47
Re: running a GUI program in the background
yes it built successfully
-
April 30th, 2013, 06:43 AM
#48
Re: running a GUI program in the background
the GUI program i am trying to run is a visual basic program
-
April 30th, 2013, 06:51 AM
#49
Re: running a GUI program in the background
Originally Posted by beginner91
the GUI program i am trying to run is a visual basic program
Well, you already mentioned it... two or three times!
And how could it matter?
Did you test the Igor's sample?
Victor Nijegorodov
-
April 30th, 2013, 06:58 AM
#50
Re: running a GUI program in the background
Did you test the Igor's sample?
yes and i got this error:
[SC] StartService FAILED 2:
The system cannot find the file specified.
-
April 30th, 2013, 07:03 AM
#51
Re: running a GUI program in the background
It only means you set a wrong path/name! Fix it!
Victor Nijegorodov
-
April 30th, 2013, 07:24 AM
#52
Re: running a GUI program in the background
the only line that has a path in it is this:
Code:
CString path = GetExeFolderName() + TEXT("C:\\testService\\Debug\\testService.exe");
and that is the correct path to the exe file so i don't know where the problem is
-
April 30th, 2013, 07:48 AM
#53
Re: running a GUI program in the background
Originally Posted by beginner91
the only line that has a path in it is this:
Code:
CString path = GetExeFolderName() + TEXT("C:\\testService\\Debug\\testService.exe");
and that is the correct path to the exe file so i don't know where the problem is
What do you expect path to contain after this statement? Have you examined its contents?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 30th, 2013, 08:00 AM
#54
Re: running a GUI program in the background
What do you expect path to contain after this statement? Have you examined its contents?
contents of what? i don't understand
-
April 30th, 2013, 08:06 AM
#55
Re: running a GUI program in the background
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().
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 30th, 2013, 08:11 AM
#56
Re: running a GUI program in the background
ok so i entered the wrong path name?
if GetExeFolderName() gets the folder, then the path should just be testService.exe?
-
April 30th, 2013, 08:48 AM
#57
Re: running a GUI program in the background
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.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 30th, 2013, 08:53 AM
#58
Re: running a GUI program in the background
this is the code for GetExeFolderName
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;
}
so if i don't need that should i just call the path like this:
CString path = TEXT("C:\\testService\\Debug\\testService.exe");
-
April 30th, 2013, 09:22 AM
#59
Re: running a GUI program in the background
so if i don't need that should i just call the path like this:
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.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 30th, 2013, 09:26 AM
#60
Re: running a GUI program in the background
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
Tags for this 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|