Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Win32 Timer and a C++ Class? Pin
Mark Salsbery13-Jun-08 5:39
Mark Salsbery13-Jun-08 5:39 
GeneralRe: Win32 Timer and a C++ Class? Pin
Steffen Lange14-Jun-08 9:05
Steffen Lange14-Jun-08 9:05 
GeneralRe: Win32 Timer and a C++ Class? Pin
Mark Salsbery14-Jun-08 10:03
Mark Salsbery14-Jun-08 10:03 
QuestionDialog window help Pin
Kwanalouie13-Jun-08 1:52
Kwanalouie13-Jun-08 1:52 
AnswerRe: Dialog window help Pin
SandipG 13-Jun-08 1:58
SandipG 13-Jun-08 1:58 
AnswerRe: Dialog window help Pin
Michael Dunn13-Jun-08 10:39
sitebuilderMichael Dunn13-Jun-08 10:39 
GeneralRe: Dialog window help Pin
Kwanalouie14-Jun-08 0:28
Kwanalouie14-Jun-08 0:28 
QuestionInsert new row in CListCtrl: need to improve the speed Pin
tataxin12-Jun-08 22:37
tataxin12-Jun-08 22:37 
I have a CListCtrl, each row has a specified color.
// the list ctrl
CListCtrl myList;

// function to set color to a row
myList.SetRowColor(j, crRows.GetAt(j));


Then I need to insert some new rows, the latest is at top. Here is source code
	CArray<colorref> crRows;
	CArray<cstring> newData;
	int nNew = newData.GetCount();
	for (int i=0; i<nnew; i++="" )="" {<br="" mode="hold" />		// insert new row at top
		CString txt = newData.GetAt(i);
		myList.InsertItem(0, txt);

		// get color, depends on the real data
		COLORREF aColor = GetRowColor(txt);
		crRows.InsertAt(0, aColor)		

		// change the rest of list ctrl
		int nCnt = myList.GetItemCount();
		for (int j = 0; j<ncnt; j++="" )="" {<br="" mode="hold" />                     myList.SetRowColor(j, crRows.GetAt(j));
		}
	}
</cstring></colorref>


I works, but because of 2 loop for, the performance speed is very slow, so I have to improve it
Does anyone know what should I do in this case??
Thanks in advance Smile | :)
AnswerRe: Insert new row in CListCtrl: need to improve the speed Pin
SandipG 12-Jun-08 23:38
SandipG 12-Jun-08 23:38 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 1:28
tataxin13-Jun-08 1:28 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
SandipG 13-Jun-08 1:34
SandipG 13-Jun-08 1:34 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 2:25
tataxin13-Jun-08 2:25 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
SandipG 13-Jun-08 2:55
SandipG 13-Jun-08 2:55 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 8:09
tataxin13-Jun-08 8:09 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin15-Jun-08 14:38
tataxin15-Jun-08 14:38 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
SandipG 15-Jun-08 19:55
SandipG 15-Jun-08 19:55 
AnswerRe: Insert new row in CListCtrl: need to improve the speed Pin
Nibu babu thomas12-Jun-08 23:50
Nibu babu thomas12-Jun-08 23:50 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 2:21
tataxin13-Jun-08 2:21 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
Nibu babu thomas13-Jun-08 2:25
Nibu babu thomas13-Jun-08 2:25 
NewsRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 2:48
tataxin13-Jun-08 2:48 
AnswerRe: Insert new row in CListCtrl: need to improve the speed Pin
Jijo.Raj13-Jun-08 6:38
Jijo.Raj13-Jun-08 6:38 
GeneralRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin13-Jun-08 8:07
tataxin13-Jun-08 8:07 
AnswerRe: Insert new row in CListCtrl: need to improve the speed Pin
tataxin16-Jun-08 15:41
tataxin16-Jun-08 15:41 
QuestionModal dialog box in a Thread Pin
iayd12-Jun-08 22:22
iayd12-Jun-08 22:22 
AnswerRe: Modal dialog box in a Thread Pin
SandipG 12-Jun-08 23:27
SandipG 12-Jun-08 23:27 

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.