[omniORB] problem when passing an interface in a function

risc risc riscman77 at gmail.com
Fri Jan 22 15:55:49 GMT 2010


Thanks Edward, so much!!! it's true :)

thanks bye


2010/1/22 Edward Lin <edwardlin.tw at gmail.com>

> Hi,
>
> You've to be aware of CORBA memory marshaling, I guess it should be
>
> CORBA::String_var p = obj->name();
>
>
> 2010/1/21 risc risc <riscman77 at gmail.com>:
> > Thanks Edward,
> >
> > i see the problem but i have the problem also if i have this function:
> >
> >   void inter2::getName( prova::inter_ptr obj )
> >   {
> >   char *p=obj->name();
> >
> >   cout<<p<<endl;
> >   }
> >
> >
> > 2010/1/21 Edward Lin <edwardlin.tw at gmail.com>
> >>
> >> Hi,
> >>
> >> At least I see one problem, you cannot "return p"; you must
> >>
> >> char* inter2::getName( ... )
> >> {
> >>    ...
> >>    return CORBA::string_dup(p);
> >> }
> >>
> >> You can refer to omniORB 'echo' example.
> >>
> >> >> server:
> >> >>
> >> >> char * inter2::getName( prova::inter_ptr obj )
> >> >> {
> >> >>  char *p=obj->name();
> >> >>
> >> >>  cout<<p<<endl
> >> >>
> >> >> return p;
> >> >> }
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100122/36de3303/attachment.htm


More information about the omniORB-list mailing list