<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bei Window Entwicklung Debug output in 2´tem Fenster Commandline]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>ich bastel zur zeit an einem simplen GDI 2D Spiel.<br />
nun hab ich das problem das das spiel halt nicht immer das macht was ich will und ich dann immer überprüfen muss ob es an falschen werten in den ganzen arrays liegt oder doch ein fehler im progging. daher würde ich gerne in einem 2´ten Fenster in der Commandline die ganzen werte ausgen wenn ich sie mal brauche..</p>
<p>das müsste doch irgendwie gehen, oder ?</p>
<p>kann mir da einer einen tipp geben wie ich das angehen muss ?</p>
<p>danke schonmal</p>
<p>kai</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/240476/bei-window-entwicklung-debug-output-in-2-tem-fenster-commandline</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 08:35:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240476.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 May 2009 05:21:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 05:21:48 GMT]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>ich bastel zur zeit an einem simplen GDI 2D Spiel.<br />
nun hab ich das problem das das spiel halt nicht immer das macht was ich will und ich dann immer überprüfen muss ob es an falschen werten in den ganzen arrays liegt oder doch ein fehler im progging. daher würde ich gerne in einem 2´ten Fenster in der Commandline die ganzen werte ausgen wenn ich sie mal brauche..</p>
<p>das müsste doch irgendwie gehen, oder ?</p>
<p>kann mir da einer einen tipp geben wie ich das angehen muss ?</p>
<p>danke schonmal</p>
<p>kai</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706852</guid><dc:creator><![CDATA[uwi2k2]]></dc:creator><pubDate>Thu, 07 May 2009 05:21:48 GMT</pubDate></item><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 05:30:39 GMT]]></title><description><![CDATA[<p>So ein Fenster brauchst du nicht erzeugen, das gibt es schon (zumindest im Visual Studio). Du kannst dir Strings mit den gewünschten Werten zurechtbasteln und mit der Funktion OutputDebugString ausgeben. Dieser Text landet dann im Ausgabe-Fenster (in dem beim Erstellen auch die Compiler- und Linker-Meldungen erscheinen). Die Funktion macht auch nur was, wenn du als Debug kompilierst und stört im Release nicht.</p>
<p>EDIT: Abgesehen davon sind natürlich auch Haltepunkte (und auch Datenhaltepunkte!) und schrittweises Ausführen (F10, F11) ein sehr sinnvoller Weg, um bestimmte Variablen oder Abläufe zu überprüfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706856</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706856</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 07 May 2009 05:30:39 GMT</pubDate></item><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 05:48:40 GMT]]></title><description><![CDATA[<p>hi _matze ,</p>
<p>danke für die schnelle antwort.<br />
dann werd ich es auf diesem wege machen.<br />
wobei mir das mit dem 2´ten fenster besser gefallen hätte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>cu<br />
kai</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706861</guid><dc:creator><![CDATA[uwi2k2]]></dc:creator><pubDate>Thu, 07 May 2009 05:48:40 GMT</pubDate></item><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 05:53:03 GMT]]></title><description><![CDATA[<p>uwi2k2 schrieb:</p>
<blockquote>
<p>wobei mir das mit dem 2´ten fenster besser gefallen hätte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
</blockquote>
<p>Natürlich könntest du dir z.B. eine Konsole erstellen (xxxConsolexxx-Funktionen), die dann deine Werte ausgibt (am besten auch nur, wenn _DEBUG definiert ist). Aber wozu dieser immense Mehraufwand, wenn's so einen Mechanismus doch schon gibt? Na ja, hauptsache man müllt sein Programm nicht zu mit Debug-Messageboxen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706862</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 07 May 2009 05:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 06:22:21 GMT]]></title><description><![CDATA[<p>jo,</p>
<p>genau diese müll message boxen will ich loserwden ...<br />
dachte mir &quot;das kanns doch nicht sein&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>cu<br />
kai</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706870</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706870</guid><dc:creator><![CDATA[uwi2k2]]></dc:creator><pubDate>Thu, 07 May 2009 06:22:21 GMT</pubDate></item><item><title><![CDATA[Reply to Bei Window Entwicklung Debug output in 2´tem Fenster Commandline on Thu, 07 May 2009 07:56:52 GMT]]></title><description><![CDATA[<p>uwi2k2 schrieb:</p>
<blockquote>
<p>hi _matze ,</p>
<p>danke für die schnelle antwort.<br />
dann werd ich es auf diesem wege machen.<br />
wobei mir das mit dem 2´ten fenster besser gefallen hätte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>cu<br />
kai</p>
</blockquote>
<p>Dazu habe ich mal folgende Funktion gefunden:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;fcntl.h&gt;
#include &lt;io.h&gt;
#include &lt;iostream&gt;
#include &lt;fstream&gt;

using namespace std;

// maximum mumber of lines the output console should have
const WORD MAX_CONSOLE_LINES = 500;

void RedirectIOToConsole()
{
	int hConHandle;
	long lStdHandle;
	CONSOLE_SCREEN_BUFFER_INFO coninfo;
	FILE *fp;

	// allocate a console for this app
	AllocConsole();

	// set the screen buffer to be big enough to let us scroll text
	GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE),	&amp;coninfo);
	coninfo.dwSize.Y = MAX_CONSOLE_LINES;
	SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE),	coninfo.dwSize);

	// redirect unbuffered STDOUT to the console
	lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
	hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);

	fp = _fdopen( hConHandle, &quot;w&quot; );

	*stdout = *fp;
	setvbuf( stdout, NULL, _IONBF, 0 );

	// redirect unbuffered STDIN to the console
	lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE);
	hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);

	fp = _fdopen( hConHandle, &quot;r&quot; );

	*stdin = *fp;
	setvbuf( stdin, NULL, _IONBF, 0 );

	// redirect unbuffered STDERR to the console
	lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE);
	hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);

	fp = _fdopen( hConHandle, &quot;w&quot; );

	*stderr = *fp;
	setvbuf( stderr, NULL, _IONBF, 0 );

	// make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog
	// point to console as well
	ios::sync_with_stdio();
}
</code></pre>
<p>Ich habe die in einer eigenen Quelldatei gespeichert. Einfach kompilieren und die Objektdatei mit der eigentlichen Anwendung zusammenlinken. Aus der Anwendung dann einmal die in dem Modul enthaltene Funktion aufrufen, und schon gehen sämtliche printf und cout - Ausgaben in ein eigenes Konsolenfenster.<br />
Achtung: Selbiges wird sofort geschlossen, wenn die Anwendung beendet wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1706914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1706914</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Thu, 07 May 2009 07:56:52 GMT</pubDate></item></channel></rss>