I'd done this before with utilities and what not but this is by far the simplest solution I've seen to getting console output into a win32 vs project. I really like it so far.
Go to properties (alt + f7).
Linker > System > SubSystem.
Change it to Console.
Go your your main file.
Go to :
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow){...}
Below that function add:
int main() {
return _tWinMain(GetModuleHandle(NULL), NULL, GetCommandLine(), SW_SHOW);
}
And your done.
No comments:
Post a Comment