Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
DOS Screen Too Quick!
Old 07-27-2004, 10:10 AM DOS Screen Too Quick!
Novice Talker

Posts: 6
Trades: 0
I wrote a C++ program that runs system calls. One of these system calls executes a Program A that is run via command prompt. When this program runs, the command window opens and closes so fast that I can't read the error that Program A is spitting out. I tried addeding in pauses after the system call but that doesn't help. I tried taking screen shots but I can't catch that split second that the window is open.

Does anyone have any other suggestions? I'm out of ideas...


Thanks!!
Shaman8933 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-27-2004, 12:50 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
Open a DOS prompt and run the C++ program from the command line as opposed to clicking on the executable.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 07-27-2004, 01:58 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
You can also try a system("PAUSE"); depending on what compiler your using.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 07-27-2004, 04:19 PM
Novice Talker

Posts: 6
Trades: 0
I can't do a system("Pause") because by the time it's executed, the window is already closed. The executable is run through another program, so although I can run it through a DOS prompt, for reasons that are too long to explain, I need it to work through this other program...
Shaman8933 is offline
Reply With Quote
View Public Profile
 
Old 07-27-2004, 07:55 PM
Rufo's Avatar
Extreme Talker

Posts: 173
Trades: 0
This might work.

Instead of running your_prog.exe, try running:
command /K your_prog.exe
Then manually exit the DOS window when finished.
__________________

Please login or register to view this content. Registration is FREE
Rufo is offline
Reply With Quote
View Public Profile Visit Rufo's homepage!
 
Old 07-27-2004, 09:03 PM
Rufo's Avatar
Extreme Talker

Posts: 173
Trades: 0
Had another idea.

This works in Windows 98 (not sure about others):
load up a DOS window
click the 'Properties' button (third from the right)
on the 'Program' tab, uncheck 'Close on exit'

Rufo.
__________________

Please login or register to view this content. Registration is FREE
Rufo is offline
Reply With Quote
View Public Profile Visit Rufo's homepage!
 
Reply     « Reply to DOS Screen Too Quick!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16594 seconds with 12 queries