Share via


Adding a Member Function

You can add a member function to any class using Class View. Using the Add Member Function Wizard adds a declaration to the header file, and adds a stub member function body to the class's implementation file, which you can then edit.

To add a member function using the Add Member Function Wizard

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

  2. Right click the class to which you want to add a member function.

  3. On the shortcut menu, click Add then click Add Function to display the Add Member Function Wizard.

  4. Provide the member function information in the appropriate wizard boxes. See Add Member Function Wizard for details.

  5. Click Finish to generate the member function code.

See Also

Tasks

Adding a Member Variable

Overriding a Virtual Function

Concepts

Adding Functionality with Code Wizards

Adding a Class

Adding an MFC Message Handler

Reference

Navigating the Class Structure