แก้ไข

แชร์ผ่าน


Adding ATL Support to Your MFC Project

If you have already created an MFC-based application, then you can add support for the Active Template Library (ATL) easily by using the IDE.

Note

This support applies only to simple COM objects added to an MFC executable or DLL project. You can add other COM objects (including ActiveX controls) to MFC projects, but the objects might not operate as expected.

  1. In Solution Explorer, right-click the project node.

  2. On the shortcut menu, click Add, and then click New Item.

  3. Choose ATL in the left pane, then choose ATL Support in the center pane.

To add ATL support to your MFC project

  1. In Solution Explorer, right-click the project node.

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

  3. Select ATL in the left pane, then choose Add ATL Support to MFC Project in the center pane.

For more information about how adding ATL support changes your MFC project's code, see Details of ATL Support Added by the ATL Wizard

See also

Adding a Class
Adding Functionality with Code Wizards
Adding a Member Function
Adding a Member Variable
Overriding a Virtual Function
MFC Message Handler
Navigating the Class Structure