C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 2nd, 2003, 11:08 PM
AnuVisual AnuVisual is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 1 AnuVisual User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #2  
Old February 3rd, 2003, 07:51 PM
ClayDowling ClayDowling is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Flint, MI
Posts: 328 ClayDowling User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 19 m 25 sec
Reputation Power: 6
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/

Reply With Quote
  #3  
Old February 10th, 2003, 08:12 AM
MaierMan's Avatar
MaierMan MaierMan is offline
Titles are useless ;)
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Germanski West
Posts: 216 MaierMan User rank is Corporal (100 - 500 Reputation Level)MaierMan User rank is Corporal (100 - 500 Reputation Level)MaierMan User rank is Corporal (100 - 500 Reputation Level)MaierMan User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 57 m 4 sec
Reputation Power: 9
Send a message via ICQ to MaierMan Send a message via AIM to MaierMan Send a message via MSN to MaierMan
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Running 3 dependent applications from inside VC++ : system command does not help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway