console window from win32
can i somehow print things out in a console window from a win32 window.
also how do i avoid using up all CPU when using a PeekMessage messageloop. i thought about setting a maximum FPS, would that work? i dont want to change my messageloop
can you give me an example as to how this works? i managed to get the window up with AllocConsole() but i dont know how to write or read aything from it.. how do i get it to print out some text?
Try
//Open consoleif (AllocConsole ()){ freopen ("CONIN$", "rb", stdin); freopen ("CONOUT$", "wb", stdout); freopen ("CONOUT$", "wb", stderr);}/*Just use it C-style*/printf ("Hello world!");//Or C++-stylecout << "Foo!" << endl;//Release consolefclose (stdin);fclose (stdout);fclose (stderr);FreeConsole ();
quote:Original post by Kippesoep
Try
//Open consoleif (AllocConsole ()){ freopen ("CONIN$", "rb", stdin); freopen ("CONOUT$", "wb", stdout); freopen ("CONOUT$", "wb", stderr);}/*Just use it C-style*/printf ("Hello world!");//Or C++-stylecout << "Foo!" << endl;//Release consolefclose (stdin);fclose (stdout);fclose (stderr);FreeConsole ();
Do we need to include iostream/stdio?
It''s Maxd Gaming, put in an underscore and I will beat you with a rubber ducky!
{ Check out my Forum } { My First Space Art (Ever) }{ My Second Space Art (Ever) }{ My upcoming space mod for Battlefield: 1942. }
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement