main(int argc, char **argv)
{
const char* channelName = "CosEventService";
CORBA::Object_var obj;
// Start orb.
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv);
// find RootPOA
obj=orb->resolve_initial_references("RootPOA");
PortableServer::POA_var rootPoa = PortableServer::POA::_narrow(obj);
// find and activate POAManager
PortableServer::POAManager_var pman =rootPoa->the_POAManager();
pman->activate();
// find NameService
obj = orb->resolve_initial_references("NameService");
文章来源于领测软件测试网 https://www.ltesting.net/