|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Running 3 dependent applications from inside VC++ : system command does not help
Hi All,
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: system("c:\\work\\scheduling-application.exe"); Sleep(2); system("c:\\work\\receiver-applicaiton.exe"); Sleep(10); system("c:\\work\\sender-applicaiton.exe"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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! |
|
#2
|
|||
|
|||
|
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.
__________________
Clay Dowling Lazarus Notes Articles and commentary on web development http://www.lazarusid.com/notes/ |
|
#3
|
||||
|
||||
|
Dont know if it helps you, cause dont know what you want to do!
API-Func: HINSTANCE ShellExecute( 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 ); or 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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Running 3 dependent applications from inside VC++ : system command does not help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|