
Using the CONSOLE for output from a Dialog-based MFC App
Quote:
> Thanks, Tomas. That article shows me how to allocate a new console and
> output to it (Q139640 is also useful in this regard), however I don't see
a
> way to output to the DOS window that initiated me. Am I missing something
> there?
Hi David,
The problem in getting what you want is how the process gets launched from
the command line. AFAIK, cmd.exe (nt) and command.com (9x) don't set the
standard handles correctly before spawing a GUI process, so you don't have a
way to get them from the gui process.
Though I haven't tried that, I believe you might be able to get around that
by createing a second executable, which is a console application. All it
would have to do is get the stdhandles and spawn the GUI app, inheriting
them to the GUI. SO in the GUI, you would have the correct handles, adn you
would be able to set them up like Q105305.
It's just a thought anyway.
--
Tomas Restrepo
http://members.xoom.com/trestrep/