Saturday, May 22, 2004

 

The Code Project - Enumdesk Clones - Tree Controls

The Code Project - Enumdesk Clones - Tree Controls: "Adding files to your project
After creating you project you can add the above downloaded class files by selecting from the Visual Studio menu. Project->Add To Project->Files and then select the class files to add. You have to add all 4 files depending on which type of project you are creating (View CShellViewClasses OR Dialog CShellCtrlClasses. CShellClass is similar in both cases).
Creating Views
To create view style Windows-Explorer like project, create a new project from the Visual Studio Wizard, select 'MFC AppWizard (exe)' , lets name the project Test. Next select 'Single Document' for type of application, click 'finish'.
Drag-Drop /copy the files listed in the Classes\ShellViewClasses folder as shown in 'Using the Code' section above. Add the class files to you project as show in the section 'Adding Files to your Project' (this is not essential).
To create only a Files View (TreeView) open the Test.cpp for editing, add the following line at the top (after TestView.h).
#include 'ShellViewClasses.h'
In the InitInstance() function change:
RUNTIME_CLASS(CTestView));
// To
RUNTIME_CLASS(CShellTreeView));
Build and execute the project.
To create a two-pane user interface, use the same project created above, in the MainFrm.h file add the following:
// Attributes
public:
CSplitterWnd m_Splitter; // Add this line
Open MainFrm.Cpp for editing, Add the following line at the top (after MainFrm.h).
#include 'ShellViewClasses.h'
Using the class-wizard add the virtual-function OnCreateClient, delete this line in the created function return CFrameWnd::OnCreateClient(lpcs, pContext"

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?