<?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[Inhalt Listbox in Datei speichern]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe hier eine kleines Problem mit einer Listbox.<br />
Und zwar:</p>
<p>Die Listbox wird mittels LB_ADDSTRING mit Zeichenketten zeilenweise<br />
gefüllt.<br />
Über LB_GETTEXT und GETTEXTLEN bekomme ich die nötigen Informationen<br />
zum Abspeichern in einen Puffer bevor alles in eine Datei geschrieben<br />
wird.<br />
Geschrieben wird auch etwas, allerdings immer nur der erste String.<br />
Mit LB_GETCURSEL bekomme ich zwar die aktuelle Auswahl, ich möchte<br />
aber, dass immer alle Strings gespeichert werden und auch in der<br />
Form, wie sie in der Listbox stehen (zeilenweise).</p>
<p>Wie hole ich den gesamten Inhalt der Listbox da heraus?</p>
<p>Und bevor jetzt wieder einige anfangen: Ja, ich habe bereits Google, MSDN und <a href="http://Codeproject.com" rel="nofollow">Codeproject.com</a> bemüht. Etwas, das in meine Richtung geht, habe ich leider (noch) nicht gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/192950/inhalt-listbox-in-datei-speichern</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 16:11:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192950.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Sep 2007 11:19:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Thu, 20 Sep 2007 11:19:19 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe hier eine kleines Problem mit einer Listbox.<br />
Und zwar:</p>
<p>Die Listbox wird mittels LB_ADDSTRING mit Zeichenketten zeilenweise<br />
gefüllt.<br />
Über LB_GETTEXT und GETTEXTLEN bekomme ich die nötigen Informationen<br />
zum Abspeichern in einen Puffer bevor alles in eine Datei geschrieben<br />
wird.<br />
Geschrieben wird auch etwas, allerdings immer nur der erste String.<br />
Mit LB_GETCURSEL bekomme ich zwar die aktuelle Auswahl, ich möchte<br />
aber, dass immer alle Strings gespeichert werden und auch in der<br />
Form, wie sie in der Listbox stehen (zeilenweise).</p>
<p>Wie hole ich den gesamten Inhalt der Listbox da heraus?</p>
<p>Und bevor jetzt wieder einige anfangen: Ja, ich habe bereits Google, MSDN und <a href="http://Codeproject.com" rel="nofollow">Codeproject.com</a> bemüht. Etwas, das in meine Richtung geht, habe ich leider (noch) nicht gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369152</guid><dc:creator><![CDATA[Fried]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:19:19 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Thu, 20 Sep 2007 11:24:31 GMT]]></title><description><![CDATA[<p>Ich weiß ja nicht wie du die MSDN bemühst, aber ich habe das hier nach 2 Sekunden gefunden.</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>LB_GETTEXT Message</p>
</blockquote>
<p>MSDN schrieb:</p>
<blockquote>
<p><strong>wParam<br />
The zero-based index of the string to retrieve.</strong></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1369164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369164</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Thu, 20 Sep 2007 11:33:16 GMT]]></title><description><![CDATA[<p>Ja, gut soweit war ich auch schon. Wenn ich das richtig verstehe, kann ich damit gezielt einzelne Einträge rausholen.</p>
<p>Aber wie bekomme ich denn nun ALLE Strings aus der Box?</p>
<p>Oder anders gefragt, wie ermittele ich wieviele Strings drin sind. (Dann kann ich das Ganze iterativ machen, sehe ich ja ein.)</p>
<p>[edit]</p>
<p>Ja,ja GetListBoxInfo ist mein Freund. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369171</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369171</guid><dc:creator><![CDATA[Fried]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Thu, 20 Sep 2007 11:45:05 GMT]]></title><description><![CDATA[<p>LB_GETCOUNT</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369199</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:45:05 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Thu, 20 Sep 2007 11:56:38 GMT]]></title><description><![CDATA[<p>Aha, werde ich gleich mal testen. Die Variante mit GetListBoxInfo() krankt im Moment daran, dass der Compiler es als nicht deklarierten Bezeichner bemängelt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369213</guid><dc:creator><![CDATA[Fried]]></dc:creator><pubDate>Thu, 20 Sep 2007 11:56:38 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt Listbox in Datei speichern on Fri, 21 Sep 2007 09:04:39 GMT]]></title><description><![CDATA[<p>Ich habe mein Programm jetzt um die gewünschte Funktionalität erweitert.</p>
<pre><code class="language-cpp">void ReadOutAndSave(HWND hWnd)
{
	FILE *fOutFile;
	char *cWriteBuffer = NULL;
	int iItemIndex = 0;
	int iItemStrLen = 0;
	char szTermStr[] = &quot;\r\n&quot;;

	iItemIndex = SendMessage(hWnd, LB_GETCOUNT, 0, 0);

	for(int i=0; i &lt; iItemIndex; i++)
	{
		fOutFile = fopen(&quot;Testext.txt&quot;, &quot;a+b&quot;);
		iItemStrLen = SendMessage(hWnd, LB_GETTEXTLEN, i, 0);
		cWriteBuffer = (char*)malloc((iItemStrLen) * sizeof(char));

		SendMessage(hWnd, LB_GETTEXT, i, (DWORD) ((LPSTR) cWriteBuffer));
		fwrite(cWriteBuffer, 1, iItemStrLen, fOutFile);
		fclose(fOutFile);
		fOutFile = fopen(&quot;Testext.txt&quot;, &quot;a+b&quot;);
		fwrite(szTermStr, 1, 3, fOutFile);
		fclose(fOutFile);
	}
}
</code></pre>
<p>Allerdings scheint mir diese Art des Zeilenumbruches etwas umständlich. Weiß jemand eine bessere Möglichkeit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1369901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1369901</guid><dc:creator><![CDATA[Fried]]></dc:creator><pubDate>Fri, 21 Sep 2007 09:04:39 GMT</pubDate></item></channel></rss>