Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 2.21 KB

adding-an-mfc-class-from-a-type-library.md

File metadata and controls

32 lines (21 loc) · 2.21 KB
description Learn more about: Adding an MFC Class from a Type Library
title Adding an MFC Class from a Type Library
ms.date 11/04/2016
helpviewer_keywords
classes [MFC], adding MFC
MFC, adding classes from type libraries
type libraries, adding MFC classes from
ms.assetid aba40476-3cfb-47af-990e-ae2e9e0d79cf

Adding an MFC Class from a Type Library

Use this wizard to create an MFC class from an interface in an available type library. You can add an MFC class to an MFC application, an MFC DLL, or an MFC ActiveX control.

Note

You do not need to create your MFC project with Automation enabled to add a class from a type library.

A type library contains a binary description of the interfaces exposed by a component, defining the methods along with their parameters and return types. Your type library must be registered for it to appear in the Available type libraries list in the Add Class from Typelib Wizard.

To add an MFC class from a type library

  1. In either Solution Explorer or Class View, right-click the name of the project to which you want to add the class.

  2. From the shortcut menu, click Add, and then click Add Class.

  3. In the Add Class dialog box, in the Templates pane, click MFC Class from Typelib, and then click Open to display the Add Class from Typelib Wizard.

In the wizard, you can add more than one class in a type library. Likewise, you can add classes from more than one type library in a single wizard session.

The wizard creates an MFC class, derived from COleDispatchDriver, for each interface you add from the selected type library. COleDispatchDriver implements the client side of OLE automation.

See also

Automation Clients
Automation Clients: Using Type Libraries