{
///
///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 upsetCodePudding user response:
AllocConsole this function returns a value to add a variable to see return true or falseCodePudding 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: