Re: gpointer in an any/BonoboArg
Michael Meeks <[email protected]> Mon, 11 Aug 2003 10:27:22 +0100
| Newsgroups | gmane.comp.gnome.components |
|---|---|
| Organization | Ximian. |
| Message-ID | <[email protected]> |
Hi Jacob, On Fri, 2003-08-08 at 06:41, Jacob Perkins wrote: > I want to put an opaque gpointer in a CORBA_any/BonoboArg, and have that > any be correctly returned from Bonobo_PropertyBag_getValue. What is the > correct typecode for the any? I've tried using TC_null and TC_void, and > while the any is returned, it's _value is always NULL (even though in > the PropertyBag, I do any->_value = opaque). You cannot get the ORB to marshal an opaque type; it's simply impossible. Thus, you have to expose the type of the structure / union / sequence / whatever, pass the correct typecode as _type, and a pointer to that value as _value. If you want to retain some degree of opacity, just get the code at the other end to walk up the typecode hierarchy until it finds the type it wants, before doing a pointer cast - then in future, you can inherit from that structure, to add fields. HTH, Michael. -- [email protected] <><, Pseudo Engineer, itinerant idiot