February 2nd, 2003, 11:08 PM
Running 3 dependent applications from inside VC++ : system command does not help
I am new to VC++ and I will be really grateful for your help.
My problem is that I want to execute 3 applications one after the other using system command in VC++ code.
Eg. My VC++ code should have something like:
Now the problem is that the above code does not run for me.
scheduling-application starts and also receiver-applicaiton starts but sender-applicaiton does not start. Rather the system hangs and I have to restart. No helpful error message just the standard error message pop-up saying "Microsoft Windows needs to close this program"
BUT if I try to run these 3 applications from outside VC++ code, they run perfectly. These 3 applications should be executed strictly in the order as shown in above code.
Can anyone please suggest what am I missing? How I should overcome this problem?
Thanks a lot!
February 3rd, 2003, 07:51 PM
Some programs are not amenable to being launched this way. imapxfer from U Washington was this way for me.
If System() isn't working, you might look at popen, which may work. There's also a Windows API command specifically for launching a program (besides System(), which is bad to use anyway). It's been two years since I did anything with the Windows API though, and I generally avoided calling external programs anyway.
Articles and commentary on web development
February 10th, 2003, 08:12 AM
Dont know if it helps you, cause dont know what you want to do!
HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
WINSHELLAPI BOOL WINAPI ShellExecuteEx(
LPSHELLEXECUTEINFO lpExecInfo // pointer to SHELLEXECUTEINFO structure
See Reference for descriptions!
Allows you to open (run) programs, files, hyperlinks! Or to print!
Last edited by MaierMan; February 10th, 2003 at 08:15 AM.