<?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[Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe!]]></title><description><![CDATA[<p>Hallo! Ich probiere grad, einen listview Fenster zu erstellen, aber ich bekomme immer den Fehler Nummer 8(ERROR_NOT_ENOUGH_MEMORY), von diesem Funktion: ListView_SetImageList(hwndLV, himlLarge, LVSIL_NORMAL) != NULL);<br />
(Ich bekomme kein Comple-time, oder Link-time Fehler)</p>
<pre><code class="language-cpp">//////////////IM HEADER: //////////
/*	Struct	*/
struct regdata {
	char username[USERNAME_LENGTH];
	char pass[PASS_LENGTH];
	char fullname[FULLNAME_LENGTH];
	char emil[EMIL_LENGTH];
	char birthday[BIRTH_LENGTH];
	int level;		//kliens nem töltheti ki/kliens kitöltése figyelmen kívűl hagyandó
};
//////////////////////ListView/////////////////////////
HWND initListView(HINSTANCE hinst,HWND hwndParent){
	HWND hList;
	LVCOLUMN LvCol; // Make Coluom struct for ListView

	InitCommonControls();
	hList = CreateWindow(WC_LISTVIEW, &quot;&quot;, WS_CHILD | WS_VISIBLE | LVS_ICON | /*LVS_EDITLABELS |*/ WS_BORDER | WS_TABSTOP
						, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT,hwndParent, NULL, hinst, NULL);
	if(hList == NULL){
		Error(&quot;Hiba a user manager ablak(ListView control failed) készítésekor&quot;);
	}
	if(!InitListViewImageLists(hList,hinst)){//elsőnek kell initializálni!!!
		Error(&quot;Ikonlista betöltése sikertelen!&quot;); 
	}

	SendMessage(hList,LVM_SETTEXTBKCOLOR, 0,(LPARAM)CLR_NONE);
    SendMessage(hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,LVS_EX_FULLROWSELECT); // Set style

	// Here we put the info on the Coulom headers
	// this is not data, only name of each header we like
    memset(&amp;LvCol,0,sizeof(LvCol)); // Reset Coluom
	LvCol.mask=LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; // Type of mask
	LvCol.cx=0x28;                                // width between each coloum
	LvCol.pszText=&quot;Állapot&quot;;                     // First Header
 	LvCol.cx=0x42;
	// Inserting Couloms as much as we want
	SendMessage(hList,LVM_INSERTCOLUMN,0,(LPARAM)&amp;LvCol); // Insert/Show the coloum
	LvCol.pszText=&quot;Felhasználónév&quot;;                          // Next coloum
    SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&amp;LvCol); // ...
	LvCol.pszText=&quot;Jelszó&quot;;                       //
    SendMessage(hList,LVM_INSERTCOLUMN,2,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;Teljes név&quot;;                              //
    SendMessage(hList,LVM_INSERTCOLUMN,3,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;E-mail&quot;;                            //
    SendMessage(hList,LVM_INSERTCOLUMN,4,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;Születési dátum&quot;;                      //
    SendMessage(hList,LVM_INSERTCOLUMN,5,(LPARAM)&amp;LvCol); // ...same as above

	return hList;
}

BOOL AppendListItem(HWND hList,struct regdata REG){
	BOOL bSuccess=0;
	LVITEM LvItem;
    memset(&amp;LvItem,0,sizeof(LvItem)); // Reset Item Struct
	//  Setting properties Of Items:
	LvItem.mask=LVIF_TEXT | LVIF_IMAGE;   // Text Style
	LvItem.cchTextMax = 256; // Max size of text

	LvItem.iItem=ListView_GetItemCount(hList);          // choose item  
	LvItem.iSubItem=0;       // Put in first coluom
	LvItem.pszText=&quot;Icon helye&quot;;
	LvItem.iImage=REG.level;
    bSuccess =SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&amp;LvItem); // Send to the Listview

	LvItem.iSubItem=1;
	LvItem.pszText=REG.username;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=2;
	LvItem.pszText=REG.pass;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=3;
	LvItem.pszText=REG.fullname;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=4;
	LvItem.pszText=REG.emil;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=5;
	LvItem.pszText=REG.birthday;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	return bSuccess;
}

/////////////////
BOOL InitListViewImageLists(HWND hwndLV,HINSTANCE hinst) 
{ 
	BOOL bSuccess=FALSE;

	InitCommonControls();

	HICON hiconItem;     
    HIMAGELIST himlLarge; 

    himlLarge = ImageList_Create(32, 32, ILC_MASK, 5, 1); 

	for(int i=ICO_ADMIN;i&lt;=ICO_OFFLINE;i++){
		hiconItem = LoadIcon(hinst, MAKEINTRESOURCE(i)); 
		if(ImageList_AddIcon(himlLarge, hiconItem)== -1)
			Error(&quot;Addicon nem sikerült!&quot;);			
		DestroyIcon(hiconItem);
	}
    if(ListView_SetImageList(hwndLV, himlLarge, LVSIL_NORMAL) != NULL){
		bSuccess = TRUE;
	}
	else
		Error(&quot;Hiba: %i&quot;,GetLastError());
	return bSuccess;
} 

////////////////////////////////////////////////////
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/133446/schwierige-listview-probleme-gt-freeman-ich-braucht-dringend-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 17:27:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/133446.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Jan 2006 20:53:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Tue, 17 Jan 2006 21:00:38 GMT]]></title><description><![CDATA[<p>Hallo! Ich probiere grad, einen listview Fenster zu erstellen, aber ich bekomme immer den Fehler Nummer 8(ERROR_NOT_ENOUGH_MEMORY), von diesem Funktion: ListView_SetImageList(hwndLV, himlLarge, LVSIL_NORMAL) != NULL);<br />
(Ich bekomme kein Comple-time, oder Link-time Fehler)</p>
<pre><code class="language-cpp">//////////////IM HEADER: //////////
/*	Struct	*/
struct regdata {
	char username[USERNAME_LENGTH];
	char pass[PASS_LENGTH];
	char fullname[FULLNAME_LENGTH];
	char emil[EMIL_LENGTH];
	char birthday[BIRTH_LENGTH];
	int level;		//kliens nem töltheti ki/kliens kitöltése figyelmen kívűl hagyandó
};
//////////////////////ListView/////////////////////////
HWND initListView(HINSTANCE hinst,HWND hwndParent){
	HWND hList;
	LVCOLUMN LvCol; // Make Coluom struct for ListView

	InitCommonControls();
	hList = CreateWindow(WC_LISTVIEW, &quot;&quot;, WS_CHILD | WS_VISIBLE | LVS_ICON | /*LVS_EDITLABELS |*/ WS_BORDER | WS_TABSTOP
						, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT,hwndParent, NULL, hinst, NULL);
	if(hList == NULL){
		Error(&quot;Hiba a user manager ablak(ListView control failed) készítésekor&quot;);
	}
	if(!InitListViewImageLists(hList,hinst)){//elsőnek kell initializálni!!!
		Error(&quot;Ikonlista betöltése sikertelen!&quot;); 
	}

	SendMessage(hList,LVM_SETTEXTBKCOLOR, 0,(LPARAM)CLR_NONE);
    SendMessage(hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,LVS_EX_FULLROWSELECT); // Set style

	// Here we put the info on the Coulom headers
	// this is not data, only name of each header we like
    memset(&amp;LvCol,0,sizeof(LvCol)); // Reset Coluom
	LvCol.mask=LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; // Type of mask
	LvCol.cx=0x28;                                // width between each coloum
	LvCol.pszText=&quot;Állapot&quot;;                     // First Header
 	LvCol.cx=0x42;
	// Inserting Couloms as much as we want
	SendMessage(hList,LVM_INSERTCOLUMN,0,(LPARAM)&amp;LvCol); // Insert/Show the coloum
	LvCol.pszText=&quot;Felhasználónév&quot;;                          // Next coloum
    SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&amp;LvCol); // ...
	LvCol.pszText=&quot;Jelszó&quot;;                       //
    SendMessage(hList,LVM_INSERTCOLUMN,2,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;Teljes név&quot;;                              //
    SendMessage(hList,LVM_INSERTCOLUMN,3,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;E-mail&quot;;                            //
    SendMessage(hList,LVM_INSERTCOLUMN,4,(LPARAM)&amp;LvCol); //
	LvCol.pszText=&quot;Születési dátum&quot;;                      //
    SendMessage(hList,LVM_INSERTCOLUMN,5,(LPARAM)&amp;LvCol); // ...same as above

	return hList;
}

BOOL AppendListItem(HWND hList,struct regdata REG){
	BOOL bSuccess=0;
	LVITEM LvItem;
    memset(&amp;LvItem,0,sizeof(LvItem)); // Reset Item Struct
	//  Setting properties Of Items:
	LvItem.mask=LVIF_TEXT | LVIF_IMAGE;   // Text Style
	LvItem.cchTextMax = 256; // Max size of text

	LvItem.iItem=ListView_GetItemCount(hList);          // choose item  
	LvItem.iSubItem=0;       // Put in first coluom
	LvItem.pszText=&quot;Icon helye&quot;;
	LvItem.iImage=REG.level;
    bSuccess =SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&amp;LvItem); // Send to the Listview

	LvItem.iSubItem=1;
	LvItem.pszText=REG.username;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=2;
	LvItem.pszText=REG.pass;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=3;
	LvItem.pszText=REG.fullname;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=4;
	LvItem.pszText=REG.emil;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	LvItem.iSubItem=5;
	LvItem.pszText=REG.birthday;
	bSuccess &amp;=SendMessage(hList,LVM_SETITEM,0,(LPARAM)&amp;LvItem); // Enter text to SubItems

	return bSuccess;
}

/////////////////
BOOL InitListViewImageLists(HWND hwndLV,HINSTANCE hinst) 
{ 
	BOOL bSuccess=FALSE;

	InitCommonControls();

	HICON hiconItem;     
    HIMAGELIST himlLarge; 

    himlLarge = ImageList_Create(32, 32, ILC_MASK, 5, 1); 

	for(int i=ICO_ADMIN;i&lt;=ICO_OFFLINE;i++){
		hiconItem = LoadIcon(hinst, MAKEINTRESOURCE(i)); 
		if(ImageList_AddIcon(himlLarge, hiconItem)== -1)
			Error(&quot;Addicon nem sikerült!&quot;);			
		DestroyIcon(hiconItem);
	}
    if(ListView_SetImageList(hwndLV, himlLarge, LVSIL_NORMAL) != NULL){
		bSuccess = TRUE;
	}
	else
		Error(&quot;Hiba: %i&quot;,GetLastError());
	return bSuccess;
} 

////////////////////////////////////////////////////
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/969332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/969332</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Tue, 17 Jan 2006 21:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Tue, 17 Jan 2006 20:58:07 GMT]]></title><description><![CDATA[<p>Nachdem ich dachte ich sei auf dem Gebiet &quot;OH MAN, WAS GEHT SCHON WIEDER SCHIEF?!!!&quot; Experte habe ich den Thread geöffnet, leider umsonst, hier gehts nämlich um ListViews.</p>
<p>Bitte aussagekräftigere Titel verwenden <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
<p>MfG SideWinder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/969335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/969335</guid><dc:creator><![CDATA[SideWinder]]></dc:creator><pubDate>Tue, 17 Jan 2006 20:58:07 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Tue, 17 Jan 2006 21:05:21 GMT]]></title><description><![CDATA[<p>Kann es einfach sein, dass deine Bilder zu groß sind und deshalb der Speicher nicht reicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/969339</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/969339</guid><dc:creator><![CDATA[javascript:resize_message]]></dc:creator><pubDate>Tue, 17 Jan 2006 21:05:21 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Tue, 17 Jan 2006 21:19:16 GMT]]></title><description><![CDATA[<p>Kann nicht sein!<br />
Dimensionen meiner Bilder: 32*32*8<br />
Größe: 2KB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/969349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/969349</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Tue, 17 Jan 2006 21:19:16 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Wed, 18 Jan 2006 07:57:46 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ListView_SetImageList liefert NULL auch im Erfolgsfall, wenn vorher keine<br />
ImageList gesetzt war !</p>
<blockquote>
<p>Returns the HIMAGELIST handle to the previous image list, if any, or NULL otherwise.</p>
</blockquote>
<p>Setze mal ein<br />
SetLastError(0);<br />
vor ListView_SetImageList und teste dann nochmal.</p>
<p>Gruß<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/969461</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/969461</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Wed, 18 Jan 2006 07:57:46 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Wed, 18 Jan 2006 21:20:30 GMT]]></title><description><![CDATA[<p>Jetzt funktioniert alles , aber trotzdem bekomme ich den error #6 (ERROR_INVALID_HANDLE) bei dieser Linie: Error(&quot;Hiba SMALL: %i&quot;,GetLastError());</p>
<pre><code class="language-cpp">/******************************************************************************

   CreateListView

******************************************************************************/

HWND CreateListView(HINSTANCE hInstance, HWND hwndParent)
{
DWORD       dwStyle;
HWND        hwndListView;
HIMAGELIST  himlSmall;
HIMAGELIST  himlLarge;
SHFILEINFO  sfi;
BOOL        bSuccess = TRUE;

HICON hiconItem,hiconItem2;

dwStyle =   WS_TABSTOP | 
            WS_CHILD | 
            WS_BORDER | 
            LVS_AUTOARRANGE |
            LVS_REPORT | 
            LVS_EDITLABELS |
            LVS_SHAREIMAGELISTS |
            WS_VISIBLE;

hwndListView = CreateWindowEx(   WS_EX_CLIENTEDGE,          // ex style
                                 WC_LISTVIEW,               // class name - defined in commctrl.h
                                 NULL,                      // window text
                                 dwStyle,                   // style
                                 0,                         // x position
                                 0,                         // y position
                                 0,                         // width
                                 0,                         // height
                                 hwndParent,                // parent
                                 (HMENU)IDC_LISTVIEW,       // ID
                                 g_hInst,                   // instance
                                 NULL);                     // no extra data

if(!hwndListView)
   return NULL;

ResizeListView(hwndListView, hwndParent);

//set the large and small icon image lists
himlSmall = /*(HIMAGELIST)SHGetFileInfo( TEXT(&quot;C:\\&quot;), 
                                       0,
                                       &amp;sfi, 
                                       sizeof(SHFILEINFO), 
                                       SHGFI_SYSICONINDEX | SHGFI_SMALLICON);*/
                                       ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 5, 1);

himlLarge = /*(HIMAGELIST)SHGetFileInfo( TEXT(&quot;C:\\&quot;), 
                                       0,
                                       &amp;sfi, 
                                       sizeof(SHFILEINFO), 
                                       SHGFI_SYSICONINDEX | SHGFI_LARGEICON);*/
                                       ImageList_Create(32, 32, ILC_COLOR24 | ILC_MASK, 5, 1);

for(int i=ICO_ADMIN;i&lt;=ICO_OFFLINE;i++){
		hiconItem = LoadIcon(g_hInst, MAKEINTRESOURCE(i));
		hiconItem2 = LoadIcon(g_hInst, MAKEINTRESOURCE(i+5));
		if(ImageList_AddIcon(himlLarge, hiconItem)== -1 || ImageList_AddIcon(himlSmall, hiconItem2)== -1)
			MessageBox(0,&quot;Addicon nem sikerült!&quot;,&quot;gg&quot;,0);			
		DestroyIcon(hiconItem);
	}

if (himlSmall &amp;&amp; himlLarge)
   {
   if(SendMessage(hwndListView, LVM_SETIMAGELIST, (WPARAM)LVSIL_SMALL, (LPARAM)himlSmall)==NULL)
                                Error(&quot;Hiba SMALL: %i&quot;,GetLastError());
   if(SendMessage(hwndListView, LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)himlLarge)==NULL)
                                Error(&quot;Hiba LARGE: %i&quot;,GetLastError());
   }
else
    {
    MessageBox(0,&quot;q&quot;,&quot;q&quot;,0);
    }

return hwndListView;
}
</code></pre>
<p>WARUM?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970124</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970124</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Wed, 18 Jan 2006 21:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Thu, 19 Jan 2006 07:42:56 GMT]]></title><description><![CDATA[<p>Morgen,</p>
<p>ich denke mal daß die LV vorher keine ImageList besitzt also kann auch keine<br />
vorhergesetzte ImageList-Handle zurückgegeben werden, daher ist == NULL falsch !</p>
<p>Beim ersten setzen der ImageList ist Rückgabe == NULL kein Fehler.</p>
<p>Oder kommt der Fehler auch, wenn Du die Funktion zweimal nacheinander aufrufts ?</p>
<p>Grüße<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/970246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/970246</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Thu, 19 Jan 2006 07:42:56 GMT</pubDate></item><item><title><![CDATA[Reply to Schwierige ListView probleme,-&amp;gt; Freeman(ich) braucht dringend Hilfe! on Fri, 20 Jan 2006 23:19:05 GMT]]></title><description><![CDATA[<p>Ich habe nachgeschaut, unf bin raufgekommen, dass du vollkommend recht hast!</p>
<p>Danke für die Hilfe Kumpel! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/971816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/971816</guid><dc:creator><![CDATA[Szabadember]]></dc:creator><pubDate>Fri, 20 Jan 2006 23:19:05 GMT</pubDate></item></channel></rss>