Define and install a new component  Generate stubs, skeletons, and implementation templates

Chapter 3: Creating C++ Components and Clients

Define the multiply method

The component interface will have one method, multiply.

StepsDefining the component interface

  1. Expand the Tutorial package. Double-click the CPPArithmetic component to show the Roles and Interfaces folders beneath it.

  2. Double-click the Interfaces folder, and highlight the Tutorial::CPPArithmetic interface. If you do not see this interface, install it as follows:

    1. Highlight the Interfaces folder and select File | Add Interfaces ...

    2. In the Install Interface dialog box, highlight Tutorial::CPPArithmetic in the Selected to Install table, then click Install.

    3. Highlight the Tutorial::CPPArithmetic interface that is now displayed under the Interfaces folder.

  3. With the Tutorial::CPPArithmetic interface highlighted, select File | New Method.

  4. Assign the name multiply to the method.

  5. Click Create New Method.

    You see the Method Properties window.

  6. In the Return field, select double as the method’s return type.

  7. Beneath the empty parameter list, click Add to add a parameter. In the New Parameter dialog:

  8. Click OK to close the New Parameter dialog box.

  9. Repeat steps 7 and 8 to add a second parameter named m2 with a Type of double.

  10. Click OK to close the Method Properties dialog box.





Copyright © 2005. Sybase Inc. All rights reserved. Generate stubs, skeletons, and implementation templates

View this book as PDF