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

C / C++ / MFC

 
QuestionRe: Shell's context menu items are all gray Pin
Maximilien8-Feb-11 5:06
Maximilien8-Feb-11 5:06 
AnswerRe: Shell's context menu items are all gray Pin
David Crow8-Feb-11 5:11
David Crow8-Feb-11 5:11 
GeneralRe: Shell's context menu items are all gray Pin
Maximilien8-Feb-11 6:47
Maximilien8-Feb-11 6:47 
GeneralRe: Shell's context menu items are all gray Pin
David Crow8-Feb-11 6:51
David Crow8-Feb-11 6:51 
QuestionIncremental search method for CEditview or CRicheditView Pin
ganesh.dp8-Feb-11 1:29
ganesh.dp8-Feb-11 1:29 
AnswerRe: Incremental search method for CEditview or CRicheditView Pin
Niklas L8-Feb-11 2:52
Niklas L8-Feb-11 2:52 
QuestionResizing controls as per screen resolution Pin
ddgalande8-Feb-11 1:27
ddgalande8-Feb-11 1:27 
AnswerRe: Resizing controls as per screen resolution Pin
Richard MacCutchan8-Feb-11 5:36
mveRichard MacCutchan8-Feb-11 5:36 
GeneralRe: Resizing controls as per screen resolution Pin
ddgalande18-Feb-11 0:18
ddgalande18-Feb-11 0:18 
GeneralRe: Resizing controls as per screen resolution Pin
Richard MacCutchan18-Feb-11 1:42
mveRichard MacCutchan18-Feb-11 1:42 
AnswerRe: Resizing controls as per screen resolution Pin
Cedric Moonen8-Feb-11 20:08
Cedric Moonen8-Feb-11 20:08 
QuestionSortItems function of CListCtrl giving a error Pin
VCProgrammer7-Feb-11 22:26
VCProgrammer7-Feb-11 22:26 
AnswerRe: SortItems function of CListCtrl giving a error Pin
CPallini7-Feb-11 22:41
mveCPallini7-Feb-11 22:41 
GeneralRe: SortItems function of CListCtrl giving a error Pin
VCProgrammer8-Feb-11 0:11
VCProgrammer8-Feb-11 0:11 
GeneralRe: SortItems function of CListCtrl giving a error Pin
CPallini8-Feb-11 0:12
mveCPallini8-Feb-11 0:12 
GeneralRe: SortItems function of CListCtrl giving a error Pin
VCProgrammer8-Feb-11 0:22
VCProgrammer8-Feb-11 0:22 
m_List.InsertColumn(0,"Name",100,100);
	m_List.InsertColumn(1,"Number",100,100);

	m_List.InsertItem(0,"Item1");
	m_List.SetItemText(0,1,"2");

	m_List.InsertItem(1,"Item2");
	m_List.SetItemText(1,1,"3");

	m_List.InsertItem(2,"Item3");
	m_List.SetItemText(2,1,"1");


I want to sort these items according to second column i.e "number" column

// Sort items by associated lParam
int CALLBACK CItemDlg::MyCompareProc(LPARAM lParam1, LPARAM lParam2, 
	LPARAM lParamSort)
{
	UNREFERENCED_PARAMETER(lParamSort);

	return (int)(lParam1 - lParam2);
}


void CItemDlg::OnBnClickedButton1()
{
	m_List.SortItems(&CItemDlg::MyCompareProc, 0);
}


when i compile this code, it shows this error

error C2664: 'CListCtrl::SortItems' : cannot convert parameter 1 from 'int (__stdcall CItemDlg::* )(LPARAM,LPARAM,LPARAM)' to 'PFNLVCOMPARE'


Thanks for helping
GeneralRe: SortItems function of CListCtrl giving a error Pin
CPallini8-Feb-11 0:33
mveCPallini8-Feb-11 0:33 
AnswerRe: SortItems function of CListCtrl giving a error Pin
David Crow8-Feb-11 4:27
David Crow8-Feb-11 4:27 
AnswerRe: SortItems function of CListCtrl giving a error Pin
Rolf Kristensen8-Feb-11 9:12
Rolf Kristensen8-Feb-11 9:12 
QuestionViewing fits image in visual c++ Pin
keval5p7-Feb-11 19:39
keval5p7-Feb-11 19:39 
AnswerRe: Viewing fits image in visual c++ Pin
Andrew Brock7-Feb-11 20:14
Andrew Brock7-Feb-11 20:14 
QuestionDesktop rect Pin
includeh107-Feb-11 7:08
includeh107-Feb-11 7:08 
AnswerRe: Desktop rect Pin
Hans Dietrich7-Feb-11 7:27
mentorHans Dietrich7-Feb-11 7:27 
AnswerRe: Desktop rect Pin
loyal ginger8-Feb-11 2:55
loyal ginger8-Feb-11 2:55 
QuestionNon-Templatized methods in Template Class? Pin
bob169727-Feb-11 4:28
bob169727-Feb-11 4:28 

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.