Click here to Skip to main content
15,921,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSave as.. Pin
Aint31-May-07 18:15
Aint31-May-07 18:15 
AnswerRe: Save as.. Pin
Christian Graus31-May-07 18:26
protectorChristian Graus31-May-07 18:26 
AnswerRe: Save as.. Pin
kishore j hp31-May-07 20:20
kishore j hp31-May-07 20:20 
AnswerRe: Save as.. Pin
Nelek31-May-07 22:15
protectorNelek31-May-07 22:15 
AnswerRe: Save as.. Pin
Nelek31-May-07 22:16
protectorNelek31-May-07 22:16 
QuestionHow to get CPU usage in vista Pin
Finix31-May-07 17:23
Finix31-May-07 17:23 
AnswerRe: How to get CPU usage in vista Pin
Nelek31-May-07 22:07
protectorNelek31-May-07 22:07 
QuestionHow to use CListCtrl with CImageList? Pin
whiteclouds31-May-07 17:13
whiteclouds31-May-07 17:13 
I'm developing an application which can display some item with a thumbnail to show it is a file or folder. So I declare a variation as CImageList which include some image and a CListCtrl variation. Then attach them together. After those, I add item and image in CListCtrl and CImageList. But the image can't be display. I hope someone can help me. Thx!
The code is following.
//The code in InitDialog()
	clsImage=new CImageList();
	clsImage->Create(32,32,ILC_COLOR8,0,2);
	lsFile.SetImageList(clsImage,LVSIL_SMALL);
//The code in show function
		lsFile.SetRedraw(FALSE);
		for(i=0;i<ItemCount;i++)
		{
			memcpy(&name_len,p,sizeof(int));
			p+=4;
			pName=new BYTE[name_len+2];
			memcpy(pName,p,name_len);
			pName[name_len]='\0';
			pName[name_len+1]='\0';
			p+=name_len;
			kind=*p;
			p++;
			memcpy(time_str,p,16);
			CBitmap *bmp=new CBitmap;
			if(kind==1)
				bmp->LoadBitmapW(IDB_FILE);
			else
				bmp->LoadBitmapW(IDB_FOLDER);
			clsImage->Add(bmp,RGB(0,0,0));
			lsFile.InsertItem(i,(LPCTSTR)pName,i);
			delete bmp;
			delete pName;
			p+=16;
		}
		lsFile.SetRedraw(TRUE);
		lsFile.Invalidate();
		lsFile.UpdateWindow();

To be simplicated, I ommit some code to declare local variation.


whiteclouds
AnswerRe: How to use CListCtrl with CImageList? Pin
Naveen31-May-07 18:03
Naveen31-May-07 18:03 
QuestionRe: How to use CListCtrl with CImageList? Pin
Hamid_RT31-May-07 18:27
Hamid_RT31-May-07 18:27 
AnswerRe: How to use CListCtrl with CImageList? Pin
whiteclouds4-Jun-07 15:41
whiteclouds4-Jun-07 15:41 
QuestionC++ reference continued Pin
C_Zealot31-May-07 13:02
C_Zealot31-May-07 13:02 
AnswerRe: C++ reference continued Pin
Christian Graus31-May-07 13:29
protectorChristian Graus31-May-07 13:29 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 14:26
Stephen Hewitt31-May-07 14:26 
GeneralRe: C++ reference continued Pin
Christian Graus31-May-07 18:28
protectorChristian Graus31-May-07 18:28 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 18:57
Stephen Hewitt31-May-07 18:57 
AnswerRe: C++ reference continued Pin
Mark Salsbery31-May-07 14:08
Mark Salsbery31-May-07 14:08 
GeneralRe: C++ reference continued Pin
C_Zealot31-May-07 14:29
C_Zealot31-May-07 14:29 
AnswerRe: C++ reference continued Pin
Jeffrey Walton31-May-07 20:39
Jeffrey Walton31-May-07 20:39 
GeneralCTreeCtrl - GetSelectedItem [modified] Pin
Vaclav_31-May-07 12:26
Vaclav_31-May-07 12:26 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 15:24
Naveen31-May-07 15:24 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 15:55
Vaclav_31-May-07 15:55 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 16:01
Naveen31-May-07 16:01 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 16:28
Vaclav_31-May-07 16:28 
QuestionErrors? C++, play with reference Pin
C_Zealot31-May-07 11:55
C_Zealot31-May-07 11:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.