[omniORB] Problem of CORBA::String in MFC Application

Guy Trudel gtrudel@mediatrix.com
Fri, 26 Nov 1999 13:50:30 -0500


> It seems to me, if there is CORBA::String_var::operator=(const char *),
both of the preceding statements should yield the same result.

If you have only CORBA::String_var(const char*) everything is ok, but
Corba::String_var also have CORBA::String_var(char*) and since string
literals are not <const char*>, this is the copy constructor called.

inline _CORBA_String_var(char *p) { _data = p; }

and not

inline _CORBA_String_var(const char* p) 
{ 
	if( p ) _data = string_dup(p);
  	else    _data = 0; 
}

Guy Trudel