Home | Overview | How Do I | Tutorial
To add an ATL (Active Template Library) class to your project, your project must have been created as an ATL COM application, or contain ATL support for MFC applications. You can use the ATL COM AppWizard to create an ATL COM application, or add an ATL object to your MFC application to implement MFC support for the Active Template Library.
You can define COM interfaces for your new ATL class when you first create it, or add them later by using the Implement Interface command from the ClassView popup menu.
To add an ATL class to your ATL COM project
The name you specify is reflected in the read-only File name box, where the implementation (.cpp) file is specified. By default, the header file and the implementation file have the same name as the class (except for a leading capital 'C' in the name).
Implementing a dual interface, derived from IDispatch, enables both COM clients and automation controllers to access your class functions. Custom interfaces are derived from IUnknown and have no restrictions on the data types you can use, such as data structures or unsigned arguments.
The Names box displays the names of the interfaces.
If you do so, the Edit Interface Information dialog box appears:
The related fields display text based on what you type in the Object short name box.
This creates the associated implementation and header files for the new class, which you can view from the ClassView pane of the Project workspace.
For more information on ATL projects and ATL COM classes, see the Active Template Library Home Page.
See Also Adding a New interface to an Existing Object or Control, Adding a Connection Point to an Object, Adding a method to an Interface or non-MFC Dispinterface, Adding an MFC Class, Adding a Generic Class