old school -- command line executable
I'm creating a good "old fashioned" command line program: no forms, no visual interface. Just a bunch of modules and a sub main(). Reads command line options.
Now my problem: I can't seem to find any way to return text to the console (command line interface). I want to return status information, but I can't find any functionality to do this. Basically I'm looking for the equivalent of a printf or cout...is this possible?
Re: old school -- command line executable
Quote:
Originally posted by DaveAMS
I'm creating a good "old fashioned" command line program: no forms, no visual interface. Just a bunch of modules and a sub main(). Reads command line options.
Now my problem: I can't seem to find any way to return text to the console (command line interface). I want to return status information, but I can't find any functionality to do this. Basically I'm looking for the equivalent of a printf or cout...is this possible?
If you're app is written in VB6 (or earlier, probably), and it is run from the command prompt (cmd.exe), you need to binary patch your compiled executable with a utility called mkconsole.exe to get your standard output to go back to cmd.exe - use the APIs GetStdHandle and WriteFile.
The mkconsole tool and source code are on this site - kinda hidden, look for console stuff.
http://mvps.org/st-software/