<?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[LVN_ITEMCHANGED temp. abschalten?]]></title><description><![CDATA[<p>Moinsn,</p>
<p>kann man die LVN_ITEMCHANGED von CListCtrl irgendwie vorübergehend 'abschalten'?</p>
<p>Folgendes Problem: Ich lese eine 105 MB grosse Textdatei ein. Zeilenweise einlesen, Einträge prüfen, tlw. formatieren und davon werden dann ca 60% ( = 101021 ) der Zeilen in einem ListCtrl angezeigt. Läuft auch.<br />
Nur jetzt kommts: Laden und ListCtrl füllen OHNE LVN_ITEMCHANGED =&gt; ca. 1:40 Min. OK, grosse datei, passt scho.<br />
Aber jetzt das ganze MIT LVN_ITEMCHANGED =&gt; ca 18 Min!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>Wäre also gut, wenn die LVN_ITEMCHANGED erst dann 'reagieren' würde, nachdem die Daten im ListCtrl stehen.</p>
<p>grüssle <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/topic/198827/lvn_itemchanged-temp-abschalten</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 20:11:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/198827.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Nov 2007 09:46:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 09:46:18 GMT]]></title><description><![CDATA[<p>Moinsn,</p>
<p>kann man die LVN_ITEMCHANGED von CListCtrl irgendwie vorübergehend 'abschalten'?</p>
<p>Folgendes Problem: Ich lese eine 105 MB grosse Textdatei ein. Zeilenweise einlesen, Einträge prüfen, tlw. formatieren und davon werden dann ca 60% ( = 101021 ) der Zeilen in einem ListCtrl angezeigt. Läuft auch.<br />
Nur jetzt kommts: Laden und ListCtrl füllen OHNE LVN_ITEMCHANGED =&gt; ca. 1:40 Min. OK, grosse datei, passt scho.<br />
Aber jetzt das ganze MIT LVN_ITEMCHANGED =&gt; ca 18 Min!!! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>Wäre also gut, wenn die LVN_ITEMCHANGED erst dann 'reagieren' würde, nachdem die Daten im ListCtrl stehen.</p>
<p>grüssle <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/1410202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410202</guid><dc:creator><![CDATA[Smitty]]></dc:creator><pubDate>Mon, 26 Nov 2007 09:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 09:56:34 GMT]]></title><description><![CDATA[<p>Wie lange dauerts, wenn du im LVN_ITEMCHANGED-Handler eine if machst die einen bool prüft und den bool setzt du nach Bedarf? <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/1410207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410207</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Mon, 26 Nov 2007 09:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 10:17:29 GMT]]></title><description><![CDATA[<p>estartu schrieb:</p>
<blockquote>
<p>Wie lange dauerts, wenn du im LVN_ITEMCHANGED-Handler eine if machst die einen bool prüft und den bool setzt du nach Bedarf? <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>
</blockquote>
<p>jep, damit gehts. Wollte es wohl zu schön machen.<br />
Vorher:</p>
<pre><code class="language-cpp">void CFileReaderView::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
    if(pNMListView-&gt;iItem == -1)
        return;

	POSITION pos = m_listCtrl.GetFirstSelectedItemPosition();
	int itm = m_listCtrl.GetNextSelectedItem(pos);

	if( itm &gt; -1 )
		SetLineNmbrSBText( itm );

	*pResult = 0;
}
</code></pre>
<p>Nachher:</p>
<pre><code class="language-cpp">void CFileReaderView::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) 
{
	if( load )
		return;

	NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

	POSITION pos = m_listCtrl.GetFirstSelectedItemPosition();
	int itm = m_listCtrl.GetNextSelectedItem(pos);

	if( itm &gt; -1 )
		SetLineNmbrSBText( itm );

	*pResult = 0;
}
</code></pre>
<p>Aber einfach ist oft doch die bessere Lösung.</p>
<p>grüssle <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/1410223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410223</guid><dc:creator><![CDATA[Smitty]]></dc:creator><pubDate>Mon, 26 Nov 2007 10:17:29 GMT</pubDate></item><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 10:51:52 GMT]]></title><description><![CDATA[<p>Falscher Ansatz. LVN_ITEMCHANGED wird immer versendet.</p>
<p>Besser: Prüfe doch einfach nach ob sich ein Status ändert, der für Dich relevant ist: LVIS_SELECTED!</p>
<p>Solange sich hier nichts tut, brauchst Du auch nichts zu machen.</p>
<pre><code class="language-cpp">void CMyDialog::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMLISTVIEW pNMLV = reinterpret_cast&lt;LPNMLISTVIEW&gt;(pNMHDR);

	// Check if any changes in the selection state
	if ((pNMLV-&gt;uChanged &amp; LVIF_STATE)==0 || ((pNMLV-&gt;uOldState &amp; LVIS_SELECTED)==(pNMLV-&gt;uNewState &amp; LVIS_SELECTED)))
		// Nothing changed
		return;
...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1410236</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410236</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 26 Nov 2007 10:51:52 GMT</pubDate></item><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 13:06:12 GMT]]></title><description><![CDATA[<p>Thx Martin,</p>
<p>mit nem bool gehts zwar auch, aber nicht so elegant. Zeitunterschied sehe ich auch keinen.</p>
<p>Und man muss nicht so aufpassen, dass der bool auch immer richtig gesetzt ist.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>grüssle <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/1410300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410300</guid><dc:creator><![CDATA[Smitty]]></dc:creator><pubDate>Mon, 26 Nov 2007 13:06:12 GMT</pubDate></item><item><title><![CDATA[Reply to LVN_ITEMCHANGED temp. abschalten? on Mon, 26 Nov 2007 13:20:30 GMT]]></title><description><![CDATA[<p>Der Performance Unterschied wird dann relevant, wenn Du z.B. aktiv auch viele Daten in dem Liest View änderst. Dann wird es nämlich teuer.</p>
<p>Jede Änderung löst bei Dir ein Suchen nach einem selektierten Item aus, was gar nicht notwendig wäre...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1410310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1410310</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 26 Nov 2007 13:20:30 GMT</pubDate></item></channel></rss>