I keep forgetting this one so let me post it once and for all. Adding a debug console to a Win32 app takes 4 lines of code.
if(AllocConsole())
{
freopen(”CONOUT$”, “wt”, stdout);SetConsoleTitle(L”Debug Console”);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED);
}
You can then printf your way out of trouble.
July 7th, 2008 at 6:07 pm
Win32 APP 디버그 콘솔…
Pierre Terdimanë‹˜ì´ ìžì‹ ì´ ë¸”ë¡œê·¸(Coder Conrner)ì— ì˜¬ë¦° (초간단) Win32 App 디버그 콘솔 코드
if(AllocConsole())
{
freopen(â€CONOUT$â€, “wtâ€, stdout);SetConsoleTitle(Lâ€Debug Consoleâ€);SetConsoleTextAttribute(GetStdHand…
July 14th, 2008 at 8:19 am
And you can easily use something like VKDebug, that can show much more text in a text-field in a separate process, while also printing variable-names:
int value1=7;
…
print(value1); // this displays “value1 = 7″