想建一个Console,把一些信息输出到上面。
怎么建立呢?
怎么输出?
大虾们支招。

解决方案 »

  1.   

    http://www.codeguru.com/Cpp/W-D/console/Redirection
      

  2.   

    A process can be associated with only one console, so the AllocConsole function fails if the calling process already has a console. A process can use the FreeConsole function to detach itself from its current console, then it can call AllocConsole to create a new console or AttachConsole to attach to another console.If the calling process creates a child process, the child inherits the new console.AllocConsole initializes standard input, standard output, and standard error handles for the new console. The standard input handle is a handle to the console's input buffer, and the standard output and standard error handles are handles to the console's screen buffer. To retrieve these handles, use the GetStdHandle function.This function is primarily used by graphical user interface (GUI) application to create a console window. GUI applications are initialized without a console. Console applications are initialized with a console, unless they are created as detached processes (by calling the CreateProcess function with the DETACHED_PROCESS flag).Requirements