![]() |
|
Use this task to add an initialization method to the source file for a CORBA client. This code is used to perform the initialization tasks needed when the client is started.
The aim of the client initialization method is to complete the following tasks to initialize the ORB and object adapter.
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 an initialization method to the source file for a CORBA client main code, edit the client source file, client.cpp, and add the following code:
int perform_initialization( int argc, char *argv[] ) { // Initialize the ORB. op = ::CORBA::ORB_init(argc, argv, "DSOM"); } cout << "Initialized ORB" << endl; return( 0 ); } ... main(int argc, char *argv[]) { ... if ( ( rc = perform_initialization( argc, argv ) ) != 0 ) exit( rc ); }
Where:
This task adds code to initialize the client environment for a CORBA client.
You need to add code to the client source file to enable the client to access naming contexts, as described in Creating CORBA client main code (client.cpp), adding code to access naming contexts.
![]() |