17 CosNaming::Name ncName;
19 ncName[0].id = CORBA::string_dup(
"OnlineViewer");
20 ncName[0].kind = CORBA::string_dup(
"");
21 OnlineViewer_var onlineViewer = NULL;
23 onlineViewer = OnlineViewer::_narrow(cxt->resolve(ncName));
25 std::cerr <<
"OnlineViewer not found: ";
27 case CosNaming::NamingContext::missing_node:
28 std::cerr <<
"Missing Node" << std::endl;
29 case CosNaming::NamingContext::not_context:
30 std::cerr <<
"Not Context" << std::endl;
32 case CosNaming::NamingContext::not_object:
33 std::cerr <<
"Not Object" << std::endl;
37 }
catch(CosNaming::NamingContext::CannotProceed &exc) {
38 std::cerr <<
"Resolve OnlineViewer CannotProceed" << std::endl;
40 }
catch(CosNaming::NamingContext::AlreadyBound &exc) {
41 std::cerr <<
"Resolve OnlineViewer InvalidName" << std::endl;
49 CosNaming::NamingContext_var cxt;
51 CORBA::Object_var nS = orb->resolve_initial_references(
"NameService");
52 cxt = CosNaming::NamingContext::_narrow(nS);
53 }
catch(CORBA::SystemException& ex) {
54 std::cerr <<
"NameService doesn't exist" << std::endl;
HRP_UTIL_EXPORT OpenHRP::OnlineViewer_var getOnlineViewer(int argc, char **argv)