

Next, open the MainFrm.cpp source file by double-clicking it in the Solution Explorer. Immediately under it, add the following method declaration: Open the MainFrm.h header file by double-clicking it in the Solution Explorer. Therefore, create an accessor for it now. The MFC Application Wizard already created a CMFCShellListCtrl object in the CMainFrame class, but it is a protected member. Immediately above that comment add this code: First, locate the following comment in the header file:

Now add a member variable of type CMFCShellListCtrl.
MFC APPLICATION WIZARD MULTIPLE TOP LEVEL DOCUMENTS CODE
Immediately underneath it add this code to include the header file for CMFCShellListCtrl:

Locate the #pragma once directive near the top of the header file. Open the view header file by double-clicking MFCShellControlsView.h in the Solution Explorer. In this section, we will add an instance of CMFCShellListCtrl to the view that the wizard created. The wizard automatically creates an application that has a standard menu bar, a standard toolbar, a standard status bar, and an Outlook bar to the left of the window with a Folders view and a Calendar view.Īdding the shell list control to the document view.If the application builds successfully, run the application by selecting Start Debugging from the Debug menu. = Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped = To build the application, from the Build menu select Build Solution.ġ>- Build started: Project: MFCShellControls, Configuration: Debug Win32 -ġ> MFCShellControls.vcxproj -> c:\users\khyuck\documents\visual studio 2012\Projects\MFCShellControls\Debug\MFCShellControls.exe Verify that the application was created successfully by building and running it.Therefore, click Finish to create our new MFC project. We are not going to make any changes to the Generated Classes pane.This will cause the wizard to create the pane to the left of the window with a CMFCShellTreeCtrl already embedded.Ĭlick Next to display the Generated Classes pane. Under Advanced frame panes, select only the Navigation pane option. On the Advanced Features pane, under Advanced features, select only ActiveX controls and Common Control Manifest.Click Next to display the Advanced Features pane. On the User Interface Features pane, make sure that the Use a menu bar and toolbar option is selected.Click Next to display the User Interface Features pane. On the Database Support pane, select None because this application does not use a database.Click Next to display the Database Support pane. Do not make any changes to the Document Template Strings pane.Click Next to display the Document Template Strings pane. On the Compound Document Support pane, select None.Leave all other options as they are.Ĭlick Next to display the Compound Document Support pane. Under Project style, select Visual Studio, and from the Visual style and colors drop down list select Office 2007 (Blue theme). Next, select Single document and select Document/View architecture support. On the Application Type pane, under Application type, clear the Tabbed documents option.The Application Type pane will be displayed. In the MFC Application Wizard dialog box, click Next.The MFC Application Wizard will be displayed. Type a name for the project, such as MFCShellControls and click OK.

Then, in the Templates pane, select MFC Application.
