Creating a Starter OLE Container

AppWizard contains options that make it easy to create a starter application with OLE container functionality.

To create a starter OLE container application

  1. On the File menu, click New.

    The New dialog box appears.

  2. Click the Projects tab.

  3. Click MFC AppWizard (exe).

  4. In the Project Name box, type Container.

    AppWizard creates a project directory with this name under the main (root) directory specified in the Location box.

  5. If necessary, use the Location box to specify a different root directory for the Container project files that AppWizard creates under the Container project directory.

  6. If any check boxes other than Win32 appear in the Platforms box, clear them.

  7. Click OK.

    AppWizard creates the project directory, and the MFC AppWizard - Step 1 dialog box appears. Click Next to accept the default options.

  8. Click Next in the MFC AppWizard - Step 2 of 6 dialog box to accept the default options.

  9. In the MFC AppWizard - Step 3 of 6 dialog box, click Container, and then click Next to continue.

  10. In the MFC AppWizard - Step 4 of 6 dialog box, click Advanced.

    The Advanced Options dialog box appears.

  11. If necessary, click the Document Template Strings tab.
    • In the File extension box, type ctr without a period.

      The extension is reflected in the Filter name box.

    • In the Doc type name box, change “Contai” to “Contr”.

    • In the Filter name box, change the entry to read “Container Files (*.ctr)”.

    • Click Close, and Next to continue to Step 5.
  12. Click Next again to accept the default options for MFC AppWizard - Step 5 of 6.

  13. In the MFC AppWizard - Step 6 of 6 dialog box, change the defaults that AppWizard suggests for class CContainerCntrItem. Select the class and make the following changes:
    • In the Class name box, change the class name to CContainerItem.

    • In the Header file box, change the filename to ContainerItem.h.

    • In the Implementation file box, change the filename to ContainerItem.cpp.
  14. Click Finish.

  15. The New Project Information dialog box appears, summarizing the settings and features AppWizard will generate for you when it creates your project.

  16. Click OK in the New Project Information dialog box.

    AppWizard creates the starter files for Container and opens the project.

In the next topic, you will build the starter Container application AppWizard just created and try out some of the features it already has. Then, you will modify the code AppWizard created to add more features.