<?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[doppelargh (clistctrl sort)]]></title><description><![CDATA[<p>argh no. 1 weil die suche deaktiviert is<br />
argh no. 2</p>
<p>ich bekomm das sortieren nich auf die reihe<br />
beim ersten anklicken der titelleiste klappts... bei allen folgenden springen mir die items irgendwie hoch und runter... kann da kein schema erkennen</p>
<p>dabei siehts so einfach aus... einfach in der callback funktion sagen welche weiter oben/weiter unten bzw. gleich</p>
<p>habs auch schon mit nem schalter versucht um die bewertung nach jedem anklicken der leiste umzudrehen... ändert auch nix</p>
<p>wär super wenn mir jemand einen kleinen funktionierenden beispielcode mit 2 spalten hätte oder weiss was ich vergessen hab<br />
thx</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/62182/doppelargh-clistctrl-sort</link><generator>RSS for Node</generator><lastBuildDate>Thu, 04 Jun 2026 01:16:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/62182.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Jan 2004 23:16:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to doppelargh (clistctrl sort) on Tue, 20 Jan 2004 23:16:06 GMT]]></title><description><![CDATA[<p>argh no. 1 weil die suche deaktiviert is<br />
argh no. 2</p>
<p>ich bekomm das sortieren nich auf die reihe<br />
beim ersten anklicken der titelleiste klappts... bei allen folgenden springen mir die items irgendwie hoch und runter... kann da kein schema erkennen</p>
<p>dabei siehts so einfach aus... einfach in der callback funktion sagen welche weiter oben/weiter unten bzw. gleich</p>
<p>habs auch schon mit nem schalter versucht um die bewertung nach jedem anklicken der leiste umzudrehen... ändert auch nix</p>
<p>wär super wenn mir jemand einen kleinen funktionierenden beispielcode mit 2 spalten hätte oder weiss was ich vergessen hab<br />
thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/440826</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440826</guid><dc:creator><![CDATA[Sovok]]></dc:creator><pubDate>Tue, 20 Jan 2004 23:16:06 GMT</pubDate></item><item><title><![CDATA[Reply to doppelargh (clistctrl sort) on Wed, 21 Jan 2004 01:23:15 GMT]]></title><description><![CDATA[<p>ganz schnell zusammengebastelt:</p>
<pre><code class="language-cpp">//Nested Hilfe-Klasse
struct ListItemData
{
	CListCtrl&amp; lvc;
	//absteigend oder aufsteigend
	bool bDescending;
	int iColumn;
};

static int CALLBACK OnCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lParam3)
{
	ListItemData&amp; lid = *reinterpret_cast&lt;ListItemData*&gt;(lParam3);

	CString strText1 = lid.lvc.GetItemText(lParam1,lid.iColumn),
			strText2 = lid.lvc.GetItemText(lParam2,lid.iColumn);

	//für Text
	return lid.bDescending ? ::lstrcmp(strText1,strText2) &gt; 0 ? -1 : 1 :
		::lstrcmp(strText1,strText2) &lt;= 0 ? -1 : 1;

	//für Zahlen
	return lid.bDescending ? ::atoi(strText1) &gt; ::atoi(strText2) ? -1 : 1 :
		::atoi(strText1) &lt; ::atoi(strText2) ? -1 : 1;
}

//Aufruf bei LVN_COLUMNCLICK

static bool a;

ListItemData lid = {lvc,a = !a,0};
lvc.SendMessage(LVM_SORTITEMSEX,reinterpret_cast&lt;WPARAM&gt;(&amp;lid),
	reinterpret_cast&lt;LPARAM&gt;(OnCompare));
</code></pre>
<p>LVM_SORTITEMSEX ist erst ab Windows 98 mit Internet Explorer 5 verfügbar, aber wer viel zu viel Zeit hat, kann auch LVM_SORTITEMS nehmen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/440849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/440849</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Wed, 21 Jan 2004 01:23:15 GMT</pubDate></item><item><title><![CDATA[Reply to doppelargh (clistctrl sort) on Thu, 22 Jan 2004 11:35:00 GMT]]></title><description><![CDATA[<p>lol hab einfach nur LVM_SORTITEMS durch LVM_SORTITEMSEX ersetzt und schon gings<br />
auf jeden fall thx für den code</p>
]]></description><link>https://www.c-plusplus.net/forum/post/441749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/441749</guid><dc:creator><![CDATA[Sovok]]></dc:creator><pubDate>Thu, 22 Jan 2004 11:35:00 GMT</pubDate></item></channel></rss>