Share via


Importing the Elements of a Type Library

OverviewHow Do I

You can use ClassWizard to wrap the elements of a type library in an MFC C++ class and add the new class to a project. A type library is a collection of controls that you either purchase or write yourself. ClassView can only view valid type libraries.

To import the elements of a type library

  1. On the View menu, click ClassWizard.

    ClassWizard appears.

  2. On any of ClassWizard's tabs, click Add Class, then click From a type library.

    The Import from Type Library dialog box appears.

  3. Select a type library and click Open.

    The Confirm Classes dialog box appears. This dialog box contains a list of classes that ClassWizard can create from information in the type library. The class names are generated by ClassWizard.

  4. Use the Name text box to rename the class that is currently selected from the list.

  5. Use the Header File and Implementation File text boxes to rename the .h and .cpp files, if you choose to. Also, you can use the Browse buttons to rename the files or cause the files to be generated in a different directory.

    All classes selected from the class list are added to these two files.

  6. Click OK.

    ClassWizard generates the specified class.