in reply to Re: Re: STDOUT and a PAR --gui executable
in thread STDOUT and a PAR --gui executable

Really? I just created a simple test application in MS VC++ 6 here, and the fprintf(stderr, ...) statements I put inside WinMain don't seem to do anything at all. (same with stdout)

In fact, I'm not sure that what the poster is asking about can be done at all, really - when you start a win32 gui application from the command prompt, the command prompt returns to you as soon as the executeable is loaded. I don't think it's possible to have a win32 gui application that interacts with the command window from which it was launched, by windows' design.

It is of course possible to have a win32 console application that hides its own console window immediately after launching, and to write a console application that detaches from its console window, but both of those will flash a console window onscreen before continuing.

I'll go check the Microsoft documentation to see if what the poster desires is even possible with windows.


Update: There's a function that's new in windows XP that'll let you re-attach to the parent console (AttachConsole) however, this still has problems, because your output will be all messed up with the returned command line prompt, and you can't really read from the console in that case.

But the cause is not helpless! Googling on AttachConsole gave this article which contains a workaround, which I'll post separately.

  • Comment on Re: Re: Re: STDOUT and a PAR --gui executable

Replies are listed 'Best First'.
Re: Re: Re: Re: STDOUT and a PAR --gui executable
by waswas-fng (Curate) on Apr 12, 2004 at 21:36 UTC
    Deleted, NM.