Creating Methods with the C++ Class Explorer

From Appmethod Topics
Jump to: navigation, search

Go Up to C++ Class Explorer Topics

This procedure illustrates how to create a method that is associated with a selected class or interface using the C++ Class Explorer.

To create a method in the C++ Class Explorer

  1. Do either of the following:
    • Open the C++ Class Explorer as described here.
    • If the C++ Class Explorer is already running , return to the C++ Class Explorer by clicking the C++ Class Explorer tab at the top of the window.
  2. In the Type List pane, select (click) the class or interface to which you want to add a method.
  3. Do either of the following:
    • Select the Add a new method to this class toolbar button ClExplAddMethod.bmp.
    • Right-click the class or interface, and select Add method from the context menu.
  4. On the Add Method To <name> dialog box, enter a name for the method in the Name box.
  5. In Return type, either enter the data type of the return function you expect to receive for the method you are adding, or select a data type from the dropdown list.
  6. In Method parameters, enter the full parameter list for the method. Opening and closing parentheses are not required. If the method does not take any parameters, this field can be left blank.
  7. To enable specific compiler directives, click the appropriate checkbox, as follows:
  8. Click Add. The method is added to the class declaration in the .h file. A stub implementation is created in the .cpp file.


See Also