Share via


Adding an Event (Visual C++)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Adding an Event (Visual C++).

From Class View, you can add an event using the Add Event Wizard only to the control class in your MFC ActiveX control project. If you want to add an event to another type of project, use the Events button in the Properties window.

To add an event to your MFC ActiveX control project

  1. In Class View, expand the project node to display the classes in the project.

  2. Right-click the project's control class.

  3. On the shortcut menu, click Add, and then click Add Event to display the Add Event Wizard.

  4. Provide the event information in the appropriate wizard boxes.

  5. Click Finish to add the event to the project.

See Also

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