| title | Adding a Member Function (Visual C++) | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | article | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 55b25ddb-541d-44ed-957c-974ef91cfc85 | |||||||||||||
| caps.latest.revision | 7 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
In Class View, you can add a member function to any class. When you do this, a declaration is added to the header file, and a stub member-function body is added to the class's implementation file, which you can then modify.
-
In Class View, expand the project node to display the classes in the project. (To open Class View, on the menu bar, choose View, Class View.)
-
Open the shortcut menu for the class you want to add a member function to, and then choose Add, Add Function.
-
Provide the appropriate details about the member function. For more information, see Add Member Function Wizard.
-
Choose the Finish button to generate the member function code.
Adding Functionality with Code Wizards
Adding a Class
Adding a Member Variable
Overriding a Virtual Function
MFC Message Handler
Navigating the Class Structure