Add Method (C++)

From RAD Studio
Jump to: navigation, search

Go Up to View Menu


Adds a method to a selected class, interface, or type in the C++ Class Explorer.

On the C++ Class Explorer Window, invoke the Add Method dialog box from either:

  • The Add a new method to this class ClExplAddMethod.png toolbar button
  • The context menu command Add method.

Note: The Add Method context menu command and Add a new method to this class ClExplAddMethod.png toolbar button are enabled only for elements that are declared in a C++ managed unit. To create a C++ unit, choose either:

  • File > New > Unit - C++Builder
  • File > New > Form - C++Builder

C++ managed units differ from ordinary C++ source files in that the header (.h) and implementation (.cpp) files are grouped together. For a C++ managed unit, the Code Editor displays a tab for the .cpp file and a tab for the .h file along the bottom of the window.

You cannot add fields, methods, or properties to VCL or FireMonkey elements using the C++ Class Explorer.


Item Description

Name

Specifies the name of the method.

Return type

Specifies the return type expected by the method.

Visibility

Specifies the visibility of the method being created. Select from:

Method parameters

Specifies the parameters expected by the method.

Directives

Specifies the C++ compiler directives used with the method. Select from:

See Also