Click here to Skip to main content
15,917,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGlobal varibles Pin
Rickard Andersson2010-Feb-03 3:19
Rickard Andersson2010-Feb-03 3:19 
GeneralRe: Global varibles Pin
pankajdaga10-Feb-03 3:28
pankajdaga10-Feb-03 3:28 
GeneralRe: Global varibles Pin
Nitron10-Feb-03 3:28
Nitron10-Feb-03 3:28 
GeneralRe: Global varibles Pin
Iain Clarke, Warrior Programmer10-Feb-03 5:56
Iain Clarke, Warrior Programmer10-Feb-03 5:56 
GeneralRe: Global varibles Pin
Abbas_Riazi10-Feb-03 9:11
professionalAbbas_Riazi10-Feb-03 9:11 
GeneralRe: Global varibles Pin
Mike Nordell10-Feb-03 11:36
Mike Nordell10-Feb-03 11:36 
QuestionHow to make a Multi-User Database connection, for multi-threaded Server Pin
Willem B10-Feb-03 3:14
Willem B10-Feb-03 3:14 
Generalsorting CLIstCtrl...help! Pin
ns10-Feb-03 2:46
ns10-Feb-03 2:46 
MSDN says:

// Sort the item in reverse alphabetical order.
static int CALLBACK 
MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
   // lParamSort contains a pointer to the list view control.
   // The lParam of an item is just its index.
   CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
   CString    strItem1 = pListCtrl->GetItemText(lParam1, 0);
   CString    strItem2 = pListCtrl->GetItemText(lParam2, 0);

   return strcmp(strItem2, strItem1);
}

void snip_CListCtrl_SortItems()
{
   // The pointer to my list view control.
   extern CListCtrl* pmyListCtrl;

   // Sort the list view items using my callback procedure.
   pmyListCtrl->SortItems(<code>MyCompareProc</code>, (LPARAM) pmyListCtrl);
}


In the above,

pmyListCtrl->SortItems(<code>MyCompareProc</code>, (LPARAM) pmyListCtrl);


there are no arguments passed to MyCompareProc> So what is it comparing? I am puzzled. I thought somehow I would need to send in the list of items in that column to the comapre function? Thats what lPAram1 and lPAram2 are right? How is it automatically stepping along my column and comapring stuff? I dont see this in the code....Confused | :confused: Confused | :confused:

Appreciate your help,
ns
GeneralRe: sorting CLIstCtrl...help! Pin
Joaquín M López Muñoz10-Feb-03 3:00
Joaquín M López Muñoz10-Feb-03 3:00 
GeneralRe: sorting CLIstCtrl...help! Pin
AlexO10-Feb-03 3:01
AlexO10-Feb-03 3:01 
GeneralRe: sorting CLIstCtrl...help! Pin
ns10-Feb-03 3:12
ns10-Feb-03 3:12 
QuestionWhat is the difference between delete[] and delete? Pin
George210-Feb-03 2:29
George210-Feb-03 2:29 
AnswerRe: What is the difference between delete[] and delete? Pin
AlexO10-Feb-03 2:46
AlexO10-Feb-03 2:46 
GeneralRe: What is the difference between delete[] and delete? Pin
George210-Feb-03 3:02
George210-Feb-03 3:02 
AnswerRe: What is the difference between delete[] and delete? Pin
karl_w10-Feb-03 3:47
karl_w10-Feb-03 3:47 
GeneralCToolBar Pin
satyavasu10-Feb-03 2:07
satyavasu10-Feb-03 2:07 
GeneralRe: CToolBar Pin
MAAK10-Feb-03 9:47
MAAK10-Feb-03 9:47 
GeneralRe: CToolBar Pin
satyavasu10-Feb-03 17:44
satyavasu10-Feb-03 17:44 
GeneralRe: CToolBar Pin
MAAK11-Feb-03 13:44
MAAK11-Feb-03 13:44 
GeneralLive video through internet Pin
Val Chis10-Feb-03 1:37
Val Chis10-Feb-03 1:37 
GeneralRe: Live video through internet Pin
Chris Meech10-Feb-03 4:45
Chris Meech10-Feb-03 4:45 
GeneralRe: Live video through internet Pin
Mike Nordell10-Feb-03 11:42
Mike Nordell10-Feb-03 11:42 
GeneralRe: Live video through internet Pin
Anonymous14-Feb-03 21:29
Anonymous14-Feb-03 21:29 
Generalwhile creating a zip file using any utility like dynazip Pin
SPGV10-Feb-03 0:05
SPGV10-Feb-03 0:05 
GeneralPreview problems :o(( Pin
doctorpi9-Feb-03 23:40
doctorpi9-Feb-03 23:40 

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.