Re: Corba_string object



Hi,

On Fri, 14 Nov 2003 17:59:42 +0100, some one wrote:
...
> struct employee
> {
>     CORBA_string name;
> }
> 
> Can I just do this?
> 
> struct employee thisemployee;
> thisemployee.name = "someone";

Only as long as you do not permit any CORBA/ORBit to free it.

Otherwise / the more correct way is to use:

/usr/include/orbit-2.0/orbit/orb-core/corba-string.h:
	CORBA_char          *CORBA_string_dup  (const CORBA_char *str);
or
	CORBA_char  *CORBA_string_alloc  (CORBA_unsigned_long len);

therefore
	thisemployee.name = CORBA_string_dup ("someone");



Regards,
Lace

-- 
Jan Kratochvil; Captive: free r/w NTFS Filesystem; http://www.jankratochvil.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]