How to access tree control from win explorer type app
Hi,
I've been coding C++ for quite a number of years, but am new to MFC
(I've used Borland Builder 3 to do something similar but the interface
and my design is differnt in what I'm doing now). I'm building a
Windows Explorer type application (MFC), yes another one of those,
similar looking interface and functionality. I used the wizard in VC++
to create the basic Windows Explorer shell and I have example code for
the shell interface, which I'll add later on. At the moment, I'm trying
to add items to the tree control from various dialogues. My question is
how can I access the CTreeCtrl from a dialogue opened from a menu
(something simliar to what "Map Network Drive" does in Windows
Explorer), so I can update it with a new item/node?
For example, in the main frame (main form) I can access the tree
control as follows
CWnd* pWnd = m_wndSplitter.GetPane(0, 0);
CLeftView* pView = DYNAMIC_DOWNCAST(CLeftView, pWnd);
CTreeCtrl & objTreeCtrl = pView->GetTreeCtrl();
I have a dialogue that is opened from one the application menus
void CmkedmApp::OnToolsMapImagePath()
{
NewTreeItemDlg objNewTreeItemDlg;
objNewTreeItemDlg.DoModal();
}
where the user can select a file that is to be added to the tree
control.
I've seen a few example programs, which have helped a great deal, but
haven't found anything yet of how to access the tree control so I can
add items to it from a different dialogue?
Regards,
Michael