How to use the CMFCShellListCtrl Class ?

Hi,I created a complete Explorer window, used a CMFCShellTreeCtrl object associated with a CMFCShellListCtrl object.
And now,i want to make the CMFCShellTreeCtrl to show the items about pdf only! i did this

writing:

void CExplorerListCtrl::OnLvnInsertitem(NMHDR *pNMHDR, LRESULT *pResult) //CExplorerListCtrl:public CMFCShellListCtrl
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO:
CString currentFolder;
GetItemPath(currentFolder,pNMLV->iItem); //pNMLV->iItem is always 0
if (GetSuffix(currentFolder).MakeLower()!=_T("pdf")) //i'm sure GetSuffix(Cstring str) is right
{
DeleteItem(pNMLV->iTem);
}

*pResult = 0;
}

program is always broken off!

Best thanks!
Topic archived. No new replies allowed.