How do I activate the console and the GUI at the same time?

Hello comunity.

How can I show the console and the GUI (Forms) at the same time .. it's for debug propouses..

Thanks.




Answer this question

How do I activate the console and the GUI at the same time?

  • Umachandar Jayachandran - MS

    Whenever I need some debug info during the execution of a GUI application, I use the following code:

    HANDLE hConsole; //Global variable

    //During software startup

    AllocConsole()

    hConsole = GetStdhandle(STD_OUTPUT_HANDLE);

    Then use the WriteConsole() function whenever you need to oupt text on your new console.


  • Tryin2Bgood

    You can build a CLR console application which spawns the windows you want. In your project properties under Linker, set the SubSystem to Console. Then the console app can instantiate your forms.



  • cngzhnmrl


    Thanks about the interest Peter, and thanks to the last sir to answer. That's SubSystem option works fine for debug.

    Best Regards



  • benwaynet

    Do you want a console application that invokes a GUI (i.e. always has a console window). Or, do you want to only have a console when debugging your GUI application

  • How do I activate the console and the GUI at the same time?