#include #include "Hello.hh" int main(int argc, char** argv) { try { // Initialise the ORB. CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB4"); // Destringifying the object reference. CORBA::Object_var obj = orb->string_to_object(argv[1]); // Narrow the object to its proper type HelloApp::Hello_ptr helloRef = HelloApp::Hello::_narrow(obj); if (CORBA::is_nil(helloRef)) { cerr << "Nil World reference" << endl; return 1; } else cout<<"Reference is catched"<sayHello("Hello"); // Print out the return value from server cout<<"From Server: "<destroy(); } catch(CORBA::COMM_FAILURE& ex) { cerr << "Caught system exception COMM_FAILURE -- unable to contact the " << "object." << endl; } catch(CORBA::SystemException&) { cerr << "Caught CORBA::SystemException." << endl; } catch(CORBA::Exception&) { cerr << "Caught CORBA::Exception." << endl; } catch(omniORB::fatalException& fe) { cerr << "Caught omniORB::fatalException:" << endl; cerr << " file: " << fe.file() << endl; cerr << " line: " << fe.line() << endl; cerr << " mesg: " << fe.errmsg() << endl; } catch(...) { cerr << "Caught unknown exception." << endl; } return 0; };