Click here to Skip to main content
16,004,991 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How does net start service_name.exe call the service? Pin
Tim Smith3-May-02 10:36
Tim Smith3-May-02 10:36 
GeneralRe: How does net start service_name.exe call the service? Pin
Craig Miller3-May-02 11:44
Craig Miller3-May-02 11:44 
GeneralTest my new hash algorithm Pin
Dominik Reichl3-May-02 8:42
Dominik Reichl3-May-02 8:42 
GeneralRe: Test my new hash algorithm Pin
Tim Smith3-May-02 9:08
Tim Smith3-May-02 9:08 
GeneralRe: Test my new hash algorithm Pin
Dominik Reichl3-May-02 9:12
Dominik Reichl3-May-02 9:12 
GeneralRe: Test my new hash algorithm Pin
Tim Smith3-May-02 9:53
Tim Smith3-May-02 9:53 
GeneralStandard Form prob! Pin
Steven Richardson3-May-02 8:42
Steven Richardson3-May-02 8:42 
Generalsorting ctreectrl's items Pin
3-May-02 8:01
suss3-May-02 8:01 
here is my code..
but in the callback function,two messageboxs contains empty string. do you know why?
when i insert an item to the tree, i had set item.lparam = info;
info is CString, which is .txt_2342_5/3/02 , type,size,and date combine in one stentence
i want to sort my tree by date, by size, and by type as window explore does.

any clue???


/*===============================================================================
Sorting a tree using CTreeCtrl::SortChildrenCB()

=================================================================================*/
CTreeCtrl *myTreeCtrl;
static int CALLBACK MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the tree control.The lParam of an item is just its handle.
CTreeCtrl *pmyTreeCtrl = (CTreeCtrl*) lParamSort;
CString strItem1 = pmyTreeCtrl->GetItemText((HTREEITEM) lParam1);
CString strItem2 = pmyTreeCtrl->GetItemText((HTREEITEM) lParam2);
AfxMessageBox(strItem1);
AfxMessageBox(strItem2);
return strcmp(strItem2, strItem1);
}

//sorting trees
void CSMPprojectDlg::SortTreeItem()
{
// Sort the tree control's items using my callback procedure.
HTREEITEM hRoot = m_TreeCtrl.GetRootItem();
HTREEITEM hNextItem = m_TreeCtrl.GetNextItem(hRoot,1);
while( hNextItem != NULL )
{
m_TreeCtrl.SetItemData(hNextItem,(DWORD)hNextItem);
hNextItem = m_TreeCtrl.GetNextItem(hNextItem,1);
}


myTreeCtrl = &m_TreeCtrl;
TVSORTCB tvs;
tvs.hParent = m_TreeCtrl.GetRootItem();
tvs.lpfnCompare = MyCompareProc;
tvs.lParam = (LPARAM)myTreeCtrl;
m_TreeCtrl.SortChildrenCB(&tvs);
MessageBox("hello");

}

void CSMPprojectDlg::SortingAtree()
{
SortTreeItem();
}


Generalrepost: my math problem Pin
lucy3-May-02 6:51
lucy3-May-02 6:51 
QuestionVStudio setting to see macro expansion? Pin
hiseldl3-May-02 6:10
hiseldl3-May-02 6:10 
AnswerRe: VStudio setting to see macro expansion? Pin
Tom Archer3-May-02 6:36
Tom Archer3-May-02 6:36 
GeneralRe: VStudio setting to see macro expansion? Pin
lucy3-May-02 6:55
lucy3-May-02 6:55 
GeneralRe: VStudio setting to see macro expansion? Pin
Tom Archer3-May-02 7:02
Tom Archer3-May-02 7:02 
GeneralRe: VStudio setting to see macro expansion? Pin
lucy3-May-02 7:11
lucy3-May-02 7:11 
GeneralRe: VStudio setting to see macro expansion? Pin
Tom Archer3-May-02 7:18
Tom Archer3-May-02 7:18 
GeneralRe: VStudio setting to see macro expansion? Pin
lucy3-May-02 7:39
lucy3-May-02 7:39 
GeneralRe: VStudio setting to see macro expansion? Pin
Tom Archer3-May-02 10:08
Tom Archer3-May-02 10:08 
GeneralRe: VStudio setting to see macro expansion? Pin
hiseldl3-May-02 7:30
hiseldl3-May-02 7:30 
GeneralRe: VStudio setting to see macro expansion? Pin
Tom Archer3-May-02 7:35
Tom Archer3-May-02 7:35 
QuestionDebug Assertion? Pin
Aoife3-May-02 5:08
Aoife3-May-02 5:08 
AnswerRe: Debug Assertion? Pin
mystro_AKA_kokie3-May-02 5:17
mystro_AKA_kokie3-May-02 5:17 
GeneralRe: Debug Assertion? Pin
Aoife3-May-02 5:31
Aoife3-May-02 5:31 
AnswerRe: Debug Assertion? Pin
Tim Smith3-May-02 5:30
Tim Smith3-May-02 5:30 
GeneralRe: Debug Assertion? Pin
Aoife3-May-02 5:55
Aoife3-May-02 5:55 
GeneralRe: Debug Assertion? Pin
Tim Smith3-May-02 6:10
Tim Smith3-May-02 6:10 

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.