[omniORB] problem when passing an interface in a function

risc risc riscman77 at gmail.com
Wed Jan 20 16:24:10 GMT 2010


Hi All,

I have a problem, when i passing an interface object to a corbaobject i
have:

idl:

module prova
{
  interface inter
   {
      attribute string name;
   };

  interface inter2
  {
     string func(in inter obj);
  };

}


client:


    CORBA::Object_var obj = orb->string_to_object(argv[1]);

    inter2_var operation=inter2::_narrow(obj);

     if( CORBA::is_nil(operation) ) {
      cerr << "Can't narrow reference to type Echo (or it was nil)." <<
endl;
      return 1;
    }

      obj = orb->resolve_initial_references("RootPOA");
      PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
     PortableServer::POAManager_var pman = poa->the_POAManager();
     pman->activate();


prova_inter_impl * o=new prova_inter_impl ();

o->setName("RISC");

inter_ptr ok=o->_this();

operation->func(ok);

cout<<"FINE";

.....


server:

char * inter2::getName( prova::inter_ptr obj )
{
   char *p=obj->name();

   cout<<p<<endl

  return p;
}


after a client run at the server print the name fine and after the client go
in segfault why?

Thanks lots
Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100120/bbde6044/attachment.htm


More information about the omniORB-list mailing list