Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect consol output from "DOS-windows" program 1

Status
Not open for further replies.

Totte

Programmer
Jun 6, 2001
317
SE
I have a programmer for PIC (WISP628) which works like a charm. The software to transfer the datas through the serial port is however running as a "DOS-application" (no GUI) and it's a bit tiresome as several parameters need to be set and the status needs to be shown.

I therefor plan to make a "front-end" for it and thought on how to transfer the printed text (printing while doing it's stuff) so it does not print on the "DOS-window" but rather send the text to my front-end.

One way is to redirect the output to a temp-file and later read that file, show the content and erase the file but it feels like a 2'nd grade solution.

So: is there a way to redirect messages from the console window (from a specific program) to "my program" and thus allowing me to work with that?

Totte
Keep making it perfect and it will end up broken.
 
Do you have the source code for the DOS program ? if not you could re-write the app so your windows program does the actual serial comms instead of the DOS one ?



Hope this helps!

Regards

BuilderSpec
 
It's available....but it's not my application. Well really it's not a DOS-program, it's just a text based without GUI but it's compiled to run under XP.

The thing is that it would be easier just to use the finished program with a applicable front-end than to alter the whole damn thing to run with a "proper" GUI-program. By making a front-end i can just download the new version of the program and continoue as nothing has happend.

But OK, until i have an answer or another possibility i will redirect the text to a file and check the return-value to determine if i have to show the contents or not.

Totte
Keep making it perfect and it will end up broken.
 
You could use pipes just like you would with a text file except set up your program to accept pipes.



James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
Thanks man! I sorta avoid M$ but i have to port it to BCB6, now i know the question & answer, so it's really only to connect the dots in sequence.

Totte
Keep making it perfect and it will end up broken.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top