|
1 | 1 | ---
|
2 |
| -description: "Learn more about: Adding an MFC Class from a Type Library" |
3 |
| -title: "Adding an MFC Class from a Type Library" |
4 |
| -ms.date: "03/21/2022" |
| 2 | +description: "Learn more about: Adding an MFC class from a type library using a Microsoft Visual Studio wizard" |
| 3 | +title: "Add an MFC class from a type Library" |
| 4 | +ms.date: 04/14/2022 |
5 | 5 | helpviewer_keywords: ["classes [MFC], adding MFC", "MFC, adding classes from type libraries", "type libraries, adding MFC classes from"]
|
6 |
| -ms.assetid: aba40476-3cfb-47af-990e-ae2e9e0d79cf |
7 | 6 | ms.custom: devdivchpfy22
|
8 | 7 | ---
|
9 |
| -# Adding an MFC Class from a Type Library |
| 8 | +# Add an MFC class from a type library |
10 | 9 |
|
11 |
| -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](../../mfc/reference/creating-an-mfc-application.md), an [MFC DLL](../../mfc/reference/creating-an-mfc-dll-project.md), or an [MFC ActiveX control](../../mfc/reference/creating-an-mfc-activex-control.md). |
| 10 | +Use this wizard to create an MFC class from an interface in a type library. You can add an MFC class to an [MFC application](../../mfc/reference/creating-an-mfc-application.md), an [MFC DLL](../../mfc/reference/creating-an-mfc-dll-project.md), or an [MFC ActiveX control](../../mfc/reference/creating-an-mfc-activex-control.md). |
12 | 11 |
|
13 | 12 | > [!NOTE]
|
14 | 13 | > You don't need to create your MFC project with Automation enabled to add a class from a type library.
|
15 | 14 |
|
16 |
| -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. |
| 15 | +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 wizard. |
17 | 16 |
|
18 |
| -### To add an MFC class from a type library |
| 17 | +## Add an MFC class from a type library |
19 | 18 |
|
20 | 19 | 1. In either **Solution Explorer** or [Class View](/visualstudio/ide/viewing-the-structure-of-code), right-click the name of the project to which you want to add the class.
|
21 | 20 |
|
22 |
| -1. From the shortcut menu, select **Add**, and then select **New Item**. |
| 21 | +1. From the shortcut menu, select **Add** > **New Item**. |
23 | 22 |
|
24 | 23 | 1. In the **Add New Item** dialog, select **Installed** packages and then select **Visual C++**.
|
25 | 24 |
|
26 | 25 | 1. In the Templates pane, select **MFC Class from Typelib**, and then select **Add** to display the [Add Class from Typelib Wizard](../../mfc/reference/add-class-from-typelib-wizard.md).
|
27 | 26 |
|
28 |
| -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. |
| 27 | +Using the wizard, you can add more than one class in a type library. You can add classes from more than one type library in a single wizard session. |
29 | 28 |
|
30 |
| -The wizard creates an MFC class, derived from [COleDispatchDriver](../../mfc/reference/coledispatchdriver-class.md), for each interface you add from the selected type library. `COleDispatchDriver` implements the client side of OLE automation. |
| 29 | +The wizard creates an MFC class derived from [`COleDispatchDriver`](../../mfc/reference/coledispatchdriver-class.md), for each interface you add from the selected type library. `COleDispatchDriver` implements the client side of OLE automation. |
31 | 30 |
|
32 | 31 | ## See also
|
33 | 32 |
|
34 |
| -[Automation Clients](../../mfc/automation-clients.md)<br/> |
| 33 | +[Automation Clients](../../mfc/automation-clients.md)\ |
35 | 34 | [Automation Clients: Using Type Libraries](../../mfc/automation-clients-using-type-libraries.md)
|
0 commit comments