Home > Net >  C # vs2019 don't display console
C # vs2019 don't display console

Time:09-30

Public class NativeMethods
{
///
///start the console
///

///
[DllImport (" kernel32. DLL)]
Public static extern bool AllocConsole ();
///
///release the console
///

///
[DllImport (" kernel32. DLL)]
Public static extern bool FreeConsole ();
}
Public _click ()
{
NativeMethods. AllocConsole ();
InitializeComponent ();
System. The Console. WriteLine (" Console start ");
System. The Console. WriteLine (" open ");

}

Winfrom vs2015 below can show the console starts, but by the vs2019 console does not display console to start, you have met this kind of problem, how to solve

CodePudding user response:

No one ever met, and upset

CodePudding user response:

AllocConsole this function returns a value to add a variable to see return true or false

CodePudding user response:

Why not just put "item type" from the "Windows Application" instead of "Console Application"?
The Console Application, of course, comes with the Console,

CodePudding user response:

refer to the second floor OrdinaryCoder response:
AllocConsole this function returns a value to add a variable to see return true or false

This window is opened, and vs2015 have showed that 2019 does not display,

CodePudding user response:

reference github_36000833 reply: 3/f
why not just put "item type" from the "Windows Application" instead of "Console Application"?
The Console Application, of course, bring their own Console,
sure there is demand, is to see here or not
  •  Tags:  
  • C #
  • Related