<?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[Problem beim Erstellen von List-View-Control]]></title><description><![CDATA[<p>Hi könnt ihr mir sagen warum der folgende Code nicht funktioniert :</p>
<pre><code class="language-cpp">// CommonControl initialisieren:
			INITCOMMONCONTROLSEX iccexCommonCtrls;
			iccexCommonCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
			iccexCommonCtrls.dwICC  = ICC_LISTVIEW_CLASSES;
			InitCommonControlsEx(&amp;iccexCommonCtrls);

			// List-View erstellen:
			hlsvLanguages = CreateWindowEx
				(
				  WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
				  WS_CHILD | WS_VISIBLE | LVS_LIST, 20, 60,
				  lDlgWidth - 40, lDlgHeight - 120,
				  hDlg, reinterpret_cast&lt;HMENU&gt;(LSV_LANGUAGES),
				  g_hInst, NULL
				);
			// Schrift setzen:
			SendMessage(hlsvLanguages,
						WM_SETFONT,
						reinterpret_cast&lt;WPARAM&gt;(GetStockObject(DEFAULT_GUI_FONT)),
						0L);
			SendMessage(hlsvLanguages, LVM_DELETEALLITEMS, 0, 0L);
			if(SendMessage(hlsvLanguages, LVM_GETITEMCOUNT, 0, 0L) == 0L)
			{
				cAcceptBtn.Enable(false);
				pszReSrcStr = GetResourceString(g_hmDllLang, STR_NO_LANG_DLLS_FOUND);		
				MessageBox(0,pszReSrcStr,0,0);
				HIMAGELIST hImgList = ImageList_Create(GetSystemMetrics(SM_CXICON),
													   GetSystemMetrics(SM_CYICON),
													   ILC_COLOR24, 1, 1);
				HICON hiNoLangsFound;
				hiNoLangsFound = LoadIcon(g_hmDllStyle, MAKEINTRESOURCE(ICO_NO_LANG_DLLS_FOUND));
				int iImgIndex = ImageList_AddIcon(hImgList, hiNoLangsFound);			
				DestroyIcon(hiNoLangsFound);
				if(SendMessage(hlbxLanguages,
							LVM_SETIMAGELIST,
							static_cast&lt;WPARAM&gt;(LVSIL_NORMAL),
							reinterpret_cast&lt;LPARAM&gt;(hImgList)) == NULL)
							MessageBox(0, &quot;Fehler beim zuweisen der ImageList&quot;,0,0);
				LVITEM lvItem;
				lvItem.mask		  = LVIF_IMAGE | LVIF_STATE | LVIF_TEXT;
				lvItem.state	  = LVIS_SELECTED;
				lvItem.stateMask  = 0;
				lvItem.iSubItem	  = 0;
				lvItem.iImage	  = iImgIndex;
				lvItem.iItem	  = 0;
				lvItem.pszText	  = pszReSrcStr;
				lvItem.cchTextMax = lstrlen(pszReSrcStr);
				if(SendMessage(hlbxLanguages,
							   LVM_INSERTITEM, 0,
							   reinterpret_cast&lt;LPARAM&gt;(&amp;lvItem)) != -1)
					MessageBox(0,&quot;&lt;Alles OK&gt;&quot;,0,0);
				FreeResourceString(pszReSrcStr); // &lt;- Speicher deallokieren
			}
</code></pre>
<p>VIelen dank für eure Mühen, wär echt wichtig! <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>
<p>PS In der 1. MsgB. steht der richtige Text, der Aufruf der Funktion GetResourceString funktioniert also, die 2. wird (leider) auch angezeigt und die dritte MessageBox zeigt '&lt;Alles OK&gt;' an -&gt; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Tja bin echt ratlos... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153578/problem-beim-erstellen-von-list-view-control</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 03:26:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153578.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Jul 2006 15:43:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem beim Erstellen von List-View-Control on Tue, 18 Jul 2006 15:43:11 GMT]]></title><description><![CDATA[<p>Hi könnt ihr mir sagen warum der folgende Code nicht funktioniert :</p>
<pre><code class="language-cpp">// CommonControl initialisieren:
			INITCOMMONCONTROLSEX iccexCommonCtrls;
			iccexCommonCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
			iccexCommonCtrls.dwICC  = ICC_LISTVIEW_CLASSES;
			InitCommonControlsEx(&amp;iccexCommonCtrls);

			// List-View erstellen:
			hlsvLanguages = CreateWindowEx
				(
				  WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
				  WS_CHILD | WS_VISIBLE | LVS_LIST, 20, 60,
				  lDlgWidth - 40, lDlgHeight - 120,
				  hDlg, reinterpret_cast&lt;HMENU&gt;(LSV_LANGUAGES),
				  g_hInst, NULL
				);
			// Schrift setzen:
			SendMessage(hlsvLanguages,
						WM_SETFONT,
						reinterpret_cast&lt;WPARAM&gt;(GetStockObject(DEFAULT_GUI_FONT)),
						0L);
			SendMessage(hlsvLanguages, LVM_DELETEALLITEMS, 0, 0L);
			if(SendMessage(hlsvLanguages, LVM_GETITEMCOUNT, 0, 0L) == 0L)
			{
				cAcceptBtn.Enable(false);
				pszReSrcStr = GetResourceString(g_hmDllLang, STR_NO_LANG_DLLS_FOUND);		
				MessageBox(0,pszReSrcStr,0,0);
				HIMAGELIST hImgList = ImageList_Create(GetSystemMetrics(SM_CXICON),
													   GetSystemMetrics(SM_CYICON),
													   ILC_COLOR24, 1, 1);
				HICON hiNoLangsFound;
				hiNoLangsFound = LoadIcon(g_hmDllStyle, MAKEINTRESOURCE(ICO_NO_LANG_DLLS_FOUND));
				int iImgIndex = ImageList_AddIcon(hImgList, hiNoLangsFound);			
				DestroyIcon(hiNoLangsFound);
				if(SendMessage(hlbxLanguages,
							LVM_SETIMAGELIST,
							static_cast&lt;WPARAM&gt;(LVSIL_NORMAL),
							reinterpret_cast&lt;LPARAM&gt;(hImgList)) == NULL)
							MessageBox(0, &quot;Fehler beim zuweisen der ImageList&quot;,0,0);
				LVITEM lvItem;
				lvItem.mask		  = LVIF_IMAGE | LVIF_STATE | LVIF_TEXT;
				lvItem.state	  = LVIS_SELECTED;
				lvItem.stateMask  = 0;
				lvItem.iSubItem	  = 0;
				lvItem.iImage	  = iImgIndex;
				lvItem.iItem	  = 0;
				lvItem.pszText	  = pszReSrcStr;
				lvItem.cchTextMax = lstrlen(pszReSrcStr);
				if(SendMessage(hlbxLanguages,
							   LVM_INSERTITEM, 0,
							   reinterpret_cast&lt;LPARAM&gt;(&amp;lvItem)) != -1)
					MessageBox(0,&quot;&lt;Alles OK&gt;&quot;,0,0);
				FreeResourceString(pszReSrcStr); // &lt;- Speicher deallokieren
			}
</code></pre>
<p>VIelen dank für eure Mühen, wär echt wichtig! <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>
<p>PS In der 1. MsgB. steht der richtige Text, der Aufruf der Funktion GetResourceString funktioniert also, die 2. wird (leider) auch angezeigt und die dritte MessageBox zeigt '&lt;Alles OK&gt;' an -&gt; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Tja bin echt ratlos... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1099893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1099893</guid><dc:creator><![CDATA[Need_Help]]></dc:creator><pubDate>Tue, 18 Jul 2006 15:43:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Erstellen von List-View-Control on Tue, 18 Jul 2006 16:00:54 GMT]]></title><description><![CDATA[<p>hlsvLanguages != hlbxLanguages</p>
<p>ps: dürftige fehlerbeschreibung</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1099903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1099903</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 18 Jul 2006 16:00:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Erstellen von List-View-Control on Tue, 18 Jul 2006 16:14:08 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p>hlsvLanguages != hlbxLanguages</p>
<p>ps: dürftige fehlerbeschreibung</p>
</blockquote>
<p>Hm ich fand die Beschr. ausreichend...du hast das Hauptprobl. ja gelößt....DANKE!, wie konnt ich das nur übersehen....</p>
<p>Aber warum kann er die ImageList nicht zuweisen:</p>
<pre><code class="language-cpp">// CommonControl initialisieren:
			INITCOMMONCONTROLSEX iccexCommonCtrls;
			iccexCommonCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
			iccexCommonCtrls.dwICC  = ICC_LISTVIEW_CLASSES;
			InitCommonControlsEx(&amp;iccexCommonCtrls);

			// List-View erstellen:
			hlsvLanguages = CreateWindowEx
				(
				  WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL,
				  WS_CHILD | WS_VISIBLE | LVS_LIST, 20, 60,
				  lDlgWidth - 40, lDlgHeight - 120,
				  hDlg, reinterpret_cast&lt;HMENU&gt;(LSV_LANGUAGES),
				  g_hInst, NULL
				);
			// Schrift setzen:
			SendMessage(hlsvLanguages,
						WM_SETFONT,
						reinterpret_cast&lt;WPARAM&gt;(GetStockObject(DEFAULT_GUI_FONT)),
						0L);
			SendMessage(hlsvLanguages, LVM_DELETEALLITEMS, 0, 0L);
			if(SendMessage(hlsvLanguages, LVM_GETITEMCOUNT, 0, 0L) == 0L)
			{
				cAcceptBtn.Enable(false);
				pszReSrcStr = GetResourceString(g_hmDllLang, STR_NO_LANG_DLLS_FOUND);
				HIMAGELIST hImgList = ImageList_Create(GetSystemMetrics(SM_CXICON),
													   GetSystemMetrics(SM_CYICON),
													   ILC_COLOR16, 1, 1);
				if(hImgList == NULL)
					MessageBox(0,0,0,0);
				HICON hiNoLangsFound;
				hiNoLangsFound = LoadIcon(g_hmDllStyle, MAKEINTRESOURCE(ICO_NO_LANG_DLLS_FOUND));
				if(hiNoLangsFound == NULL)
					MessageBox(0,0,0,0);
				int iImgIndex = ImageList_AddIcon(hImgList, hiNoLangsFound);			
				if(iImgIndex == -1)
					MessageBox(0,0,0,0);
				DestroyIcon(hiNoLangsFound);
				if(SendMessage(hlsvLanguages, LVM_SETIMAGELIST,
							static_cast&lt;WPARAM&gt;(LVSIL_NORMAL),
							reinterpret_cast&lt;LPARAM&gt;(hImgList)) == NULL)
							MessageBox(0, &quot;Fehler beim zuweisen der ImageList&quot;,0,0);
				LVITEM lvItem;
				lvItem.mask		  = LVIF_IMAGE | LVIF_STATE | LVIF_TEXT;
				lvItem.state	  = LVIS_SELECTED;
				lvItem.stateMask  = 0;
				lvItem.iSubItem	  = 0;
				lvItem.iImage	  = iImgIndex;
				lvItem.iItem	  = 0;
				lvItem.pszText	  = pszReSrcStr;
				lvItem.cchTextMax = lstrlen(pszReSrcStr);
				SendMessage(hlsvLanguages, LVM_INSERTITEM, 0,
							reinterpret_cast&lt;LPARAM&gt;(&amp;lvItem));
				FreeResourceString(pszReSrcStr); // &lt;- Speicher deallokieren
			}
</code></pre>
<p>Das Icon wird erfolgreich geladen, aber das zuweisen funzt nicht... es wird lediglich diese MessageBox angezeigt:<br />
MessageBox(0, &quot;Fehler beim zuweisen der ImageList&quot;,0,0);<br />
Er erstellt zwar den Eintrag (endlich <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="🙂"
    /> ) aber der hat kein Icon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1099910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1099910</guid><dc:creator><![CDATA[Need_Help]]></dc:creator><pubDate>Tue, 18 Jul 2006 16:14:08 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Erstellen von List-View-Control on Wed, 19 Jul 2006 13:47:38 GMT]]></title><description><![CDATA[<p>Ok gelößt...man darf beim zuweisen der ImgList nicht LVSIL_NORMAL, sondern LVSIL_SMALL angeben, wenn man das ListView Control mit LVS_LIST erstellt hat...also bis man darauf kommt -.- <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1100410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100410</guid><dc:creator><![CDATA[Need_Help]]></dc:creator><pubDate>Wed, 19 Jul 2006 13:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem beim Erstellen von List-View-Control on Wed, 19 Jul 2006 15:15:45 GMT]]></title><description><![CDATA[<p>Hui, hab noch n Problem...:</p>
<p>Weiß vllt. jemand wie ich an die Zusatzdaten eines Eintrags herankomme (also lvItem.lParam) ?<br />
Das Item kann ich nicht anhand des Textes identifizieren, da sich dieser laufend ändert...</p>
<p>Gibts nicht so eine Nachricht, ähnlich wie bei Listboxen..LB_GETITEMDATA...oder so?</p>
<p>Vielen Dank für weitere Hilfe <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1100487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1100487</guid><dc:creator><![CDATA[Need_Help]]></dc:creator><pubDate>Wed, 19 Jul 2006 15:15:45 GMT</pubDate></item></channel></rss>