|
1 | 1 | --- |
2 | 2 | description: "Learn more about: Adding an MFC Class from a Type Library" |
3 | 3 | title: "Adding an MFC Class from a Type Library" |
4 | | -ms.date: "11/04/2016" |
| 4 | +ms.date: "03/21/2022" |
5 | 5 | helpviewer_keywords: ["classes [MFC], adding MFC", "MFC, adding classes from type libraries", "type libraries, adding MFC classes from"] |
6 | 6 | ms.assetid: aba40476-3cfb-47af-990e-ae2e9e0d79cf |
| 7 | +ms.custom: devdivchpfy22 |
7 | 8 | --- |
8 | 9 | # Adding an MFC Class from a Type Library |
9 | 10 |
|
10 | 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). |
11 | 12 |
|
12 | 13 | > [!NOTE] |
13 | | -> You do not need to create your MFC project with Automation enabled to add a class from a type library. |
| 14 | +> You don't need to create your MFC project with Automation enabled to add a class from a type library. |
14 | 15 |
|
15 | 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. |
16 | 17 |
|
17 | 18 | ### To add an MFC class from a type library |
18 | 19 |
|
19 | 20 | 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. |
20 | 21 |
|
21 | | -1. From the shortcut menu, click **Add**, and then click **Add Class**. |
| 22 | +1. From the shortcut menu, select **Add**, and then select **New Item**. |
22 | 23 |
|
23 | | -1. In the [Add Class](../../ide/adding-a-class-visual-cpp.md#add-class-dialog-box) dialog box, in the Templates pane, click **MFC Class from Typelib**, and then click **Open** to display the [Add Class from Typelib Wizard](../../mfc/reference/add-class-from-typelib-wizard.md). |
| 24 | +1. In the **Add New Item** dialog, select **Installed** packages and then select **Visual C++**. |
| 25 | + |
| 26 | +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). |
24 | 27 |
|
25 | 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. |
26 | 29 |
|
|
0 commit comments