#include #include #include using namespace std; void test(Echo_ptr echo) { st_fi_t *p = new st_fi_t; cout << "... Calling Server (" << sizeof(*p) << ") bytes ..." << endl; echo->st_fi(*p); cout << "... Done..." << endl; } int main(int argc, char** argv) { try { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); CORBA::Object_ptr obj = orb->string_to_object(argv[1]); Echo_ptr echo = Echo::_narrow(obj); if (CORBA::is_nil(echo)) { cerr << "Can't narrow reference to type Echo (or it was nil)." << endl; return 1; } test(echo); orb->destroy(); } catch(CORBA::TRANSIENT&) { cerr << "Caught system exception TRANSIENT -- unable to contact the " << "server." << endl; } catch(CORBA::SystemException& ex) { cerr << "Caught a CORBA::" << ex._name() << endl; } catch(CORBA::Exception& ex) { cerr << "Caught CORBA::Exception: " << ex._name() << 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; } return 0; }