[Enterprise Extensions only]

Creating CORBA client main code (client.cpp), adding include statements and global declarations

Use this task to add the include statements and global declarations needed to the source file for a CORBA client main code. This task is one step of the parent task to create the CORBA client main code, as described in Creating a CORBA client main code (client.cpp).

To add include statements and global declarations to the source file for a CORBA client main code, edit the client source file, client.cpp to complete the following steps:

  1. Add the following include statements:
    #include "servant.hh"
    #include <CosNaming.hh>

    Where:

    servant.hh
    Specifies the name of the client-side usage bindings file for the server implementation class, servant. This file is created when the server implementation class IDL is compiled, as described in Compiling a CORBA server implementation class IDL (using idlc).
    CosNaming.hh
    Specifies the header file for the COSNaming functions.

  2. Add the following global declaration:
    static ::CORBA::ORB_ptr op;

    Where:

    ::CORBA::ORB_ptr op
    Declares a pointer to the ORB.

You can also add the code for the functions needed in the client main code, as described in the parent task Creating a CORBA client main code (client.cpp).