I am using Visual Studio Community 2017/C++ and AGK Trial 2 to develop GUI apps. The Console output nor the VS output don't show any debug messages, whereas the exact same code worked fine with Visual Studio 2010. To start with I used an AGK template VS2015 project and inserted my old working AGK code to it. It builds and runs perfectly in VS2017, but the Console doesn't show any debugging messages printed with "cout", as it did when using VS2010. The following code is the function I used to pop up the Console:
// for the console to display "cout" outputs, all these must be included
// And later these should be removed when you program is fully debugge
hCrt = _open_osfhandle(
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
int i = setvbuf( stdout, NULL, _IONBF, 0 );
// in the main code
cout << "Hi, Hello World";
As is see in the attached snapshot, the Console pops up but stays blank, though the is no runtime complains from the
system about the cout << "Hi ..".
Experts, any ideas why this happens? I hope there is a workaround for this problem, sample code is highly appreciated.
A side note, I am using a trial version of AGK package, where I don't have a debug version of AGKWindows.lib so I can't
build VS2017 in debug mode. This makes debugging with console messages the only option for right now.
After all as long as I have a way to debug, I will be happy. But I don't know if the retail version of AGK has the debug version of the AGKWindows.lib in C++. Any comments or suggestions along this avenue are also appreciated.