I include this class in my project. I use a dialog. When I compile the demo project it's go OK but when I do the same in my project the scheme (I don't know how to say it, the lines and + and -) it doesn't appear.
After I create the tree I want the user to be able to set the new path by typing the value in to an edit box and clicking at button. But the path never changes after the tree is created. The getchilditem always returns null even if I pass it TVI_ROOT?
I have the tree working in the leftview of my spliiter app
so that it will only show the directories and
What I need is to find out how to get the left side of my
app to communicate the path string of a selected folder or
subfolder to the rightview.
What I am working on is an explorer interface that will
allow my users to select which files they would like to run
a particular routine on. I know this sounds strange but
since there are no extensions on the files that need to be
worked I cannot register my program with Windows and so
This control works nice but I was wondering of there is a way to remove the parent directory from the display so that it only shows the files or folders in that directory, similar to the way that Favorites work in IE. I'm trying to add bookmark functionality to a program.
I had a problem with setting the root directory to something besides NULL. It wouldn't expand the parent when displayed. I think this had something to do with SearchSibling() not handling this. I just added
to the end of the DisplayTree() to get this fixed.
I don't unserstand why the DirTreeCtrl doesn't accept the Drag&Drop op�rations. I would use these operations to drag&drop from the tree to an other tree in a sdi splitted.
If someone can help me, thanks a lot.
I found this code is fantastic, especially for beginner. But I tried to attach these code on two modeless dialogs in my project, and I encountered an assertion error. Could you please help to solve this problem?
The error was in this section
I am getting an assertion error on using a second instance of this class. This happens when the
if ( !m_imgList.Attach( hImgList ) ) in ::GetSysImgList.
The assertion is in line winctrl2.cpp
BOOL CImageList::Attach(HIMAGELIST hImageList)
ASSERT(m_hImageList == NULL); // only attach once, detach on destroy
ASSERT(FromHandlePermanent(hImageList) == NULL);
When displaying directories only
(m_DirTree.DisplayTree( NULL, NULL);
I found that the selected directory (_getcwd in this case) is not shown higlighted initially. I added a line to rectify this.
BOOL CDirTreeCtrl::SetSelPath(LPCTSTR strPath)
if ( hParent ) // Ok the last subpath was found
Select(hParent , TVGN_DROPHILITE); //---> added by me
SelectItem( hParent ); // select the last expanded item bRet = TRUE;
bRet = FALSE;