<DIV>help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:</DIV> <DIV>i am using omniORB4.1.1 under msvc++6.0 + sp6,i test the example(echo),client execute hello fuction succefully ,when client exit ,then server display the exception below,but server does not exit and run continue:</DIV> <DIV>First-chance exception in TestCorba.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.</DIV> <DIV>my program is below:</DIV> <DIV>*********server***********</DIV> <DIV> char* Echo_i::echoString(const char* mesg)<BR>{<BR> char RetStr[256];<BR> strcpy(RetStr,mesg);<BR> strcat(RetStr,"--from Server");<BR> //return RetStr;<BR> return CORBA::string_dup(RetStr);<BR>}</DIV> <DIV>int main(int argc, char** argv)</DIV> <DIV> const char* options[][2] = { { "endPoint", "giop:tcp::1234" },{ 0, 0 } };</DIV>
<DIV> try <BR> {<BR> CORBA::ORB_var orb = CORBA::ORB_init(argc, </DIV> <DIV> argv,"omniORB4",options);//,options</DIV> <DIV> CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA");//RootPOA<BR> PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);<BR> Echo_i* myecho = new Echo_i();<BR> PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId("EchoService"); <BR> poa->activate_object_with_id(oid, myecho); <BR> obj = myecho->_this();</DIV> <DIV> CORBA::String_var sior(orb->object_to_string(obj));<BR> cerr << "" <<
(char*)sior << "" << endl; <BR> myecho->_remove_ref(); <BR> PortableServer::POAManager_var pman = poa->the_POAManager();<BR> pman->activate(); <BR> orb->run();<BR> }<BR> catch(CORBA::SystemException&) <BR> {<BR> cerr << "Caught CORBA::SystemException." << endl;<BR> }<BR> catch(CORBA::Exception&) <BR> {<BR> cerr << "Caught CORBA::Exception." << endl;<BR> }<BR>
catch(omniORB::fatalException& fe) {<BR> cerr << "Caught omniORB::fatalException:" << endl;<BR> cerr << " file: " << fe.file() << endl;<BR> cerr << " line: " << fe.line() << endl;<BR> cerr << " mesg: " << fe.errmsg() << endl;<BR> }<BR> catch(...) {<BR> cerr << "Caught unknown exception." <<
endl;<BR> }<BR> return 0;</DIV> <DIV>}</DIV> <DIV><BR>****client**********</DIV> <DIV>int main(int argc, char** argv)</DIV> <DIV> try {<BR> CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB4"); <BR> CORBA::Object_var obj = orb->string_to_object ("corbaloc:iiop:172.20.56.141:1234/EchoService"); <BR> Echo_var echoref = Echo::_narrow(obj); <BR> if( CORBA::is_nil(echoref) ) <BR> {<BR> cerr << "Can't narrow reference to type Echo (or it was nil)." << endl;<BR> return 1;<BR> }<BR> <BR> // for (CORBA::ULong count=0; count<10; count++) <BR> hello(echoref); <BR>
orb->destroy();<BR> }<BR> catch(CORBA::TRANSIENT&) {<BR> cerr << "Caught system exception TRANSIENT -- unable to contact the "<BR> << "server." << endl;<BR> }<BR> catch(CORBA::SystemException& ex) {<BR> cerr << "Caught a CORBA::" << ex._name() << endl;<BR> }<BR> catch(CORBA::Exception& ex) {<BR> cerr << "Caught CORBA::Exception: " << ex._name() << endl;<BR> }<BR> catch(omniORB::fatalException& fe) {<BR> cerr << "Caught omniORB::fatalException:" << endl;<BR> cerr << " file: " << fe.file() << endl;<BR> cerr << " line: " << fe.line() << endl;<BR> cerr << " mesg: " << fe.errmsg() << endl;<BR>
}<BR> return 0;<BR>}</DIV><p> 
<hr size=1><a href="http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline">ÑÅ»¢ÓÊÏä´«µÝÐÂÄê×£¸££¬¸öÐԺؿ¨ËÍÇ×Åó£¡</a>