1

Topic: Operation with a console window

I in MFC-dialogue, as OnInitDIalog wrote::: AllocCOnsole (); freopen ("CONIN $", "rt", stdin);//for input freopen ("CONOUT $", "wt", stdout);//for an output freopen ("CONOUT $", "wt", stderr);//for an output of error messages the Console window opens, it works - on it texts are entered and deduced. But is on a screen background, and in the foreground there is a dialog box of my program. Whether it is possible to move program a console window from a background on the foreground and on the contrary - whether it is possible to move program a console window from the foreground on a background? And whether it is possible to close program a console window (at end of operation with the program)? If yes, as it can be made?

2

Re: Operation with a console window

Hello, RussianFellow, you wrote: RF> I in MFC-dialogue, as OnInitDIalog wrote: RF> RF>:: AllocCOnsole (); RF> freopen ("CONIN $", "rt", stdin);//for input RF> freopen ("CONOUT $", "wt", stdout);//for output RF> freopen ("CONOUT $", "wt", stderr);//for an output of error messages RF> RF> the Console window opens, it works - on it texts are entered and deduced. But is on a screen background, and in the foreground there is a dialog box of my program. Whether RF> it is possible to move program a console window from a background on the foreground and on the contrary - whether it is possible to move program a console window from the foreground on a background? RF> and whether it is possible to close program a console window (at end of operation with the program)? RF> If yes as it can be made? I already wrote to you: refuse a console window and deduce the data in a dialog box. Then all problems with a console window disappear. Do not frighten users of the program of these black windows.

3

Re: Operation with a console window

Hello, RussianFellow, you wrote: RF> I in MFC-dialogue, as OnInitDIalog wrote: RF> RF>:: AllocCOnsole (); RF> freopen ("CONIN $", "rt", stdin);//for input RF> freopen ("CONOUT $", "wt", stdout);//for output RF> freopen ("CONOUT $", "wt", stderr);//> 1) the Console window is not necessary for an output of error messages RF - from a word absolutely!!! 2) What for generally to confuse the code of operation to files, in this case a call freopen with functional GUI (to put it in OnInitDIalog)? If there is a necessity of operation with files - it is not necessary ' to push it ' in a dialog box, to make it in the successor from CWinApp more correctly.