[omniORB] string_dup() behavior

Visscher, Bruce VISSCHB@RJRT.com
Fri Jul 12 02:09:01 2002


This is a multi-part message in MIME format.

------=_NextPartTM-000-8a0d8329-b677-4409-9799-7ef6f63f2d98
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

> {
>   CORBA::String_var the String =3D CORBA::string_dup("name");
> }

I don't really see why this should be a problem (except for the obvious =
typo in the variable name).

Are you sure you used consistent compiler options?  If you link against =
the omniORB DLLs you must configure your project to compile
and link against the multi-threaded DLL version of the MSC run time.

In any case, you should always cast literal strings to "pointer to const =
char" to be on the safe side.  The C++ standard mandates
that string literals are of this type already so the cast wouldn't be =
needed with a standards conforming compiler.

The CORBA C++ mapping made some unfortunate choices regarding pointers =
to non-const char.

HTH,

Bruce

------=_NextPartTM-000-8a0d8329-b677-4409-9799-7ef6f63f2d98
Content-Type: text/plain;
	name="InterScan_Disclaimer.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="InterScan_Disclaimer.txt"

CONFIDENTIALITY NOTE:  This e-mail message, including any attachment(s), contains information that may be confidential, protected by the attorney-client or other legal privileges, and/or proprietary non-public information.  If you are not an intended recipient of this message or an authorized assistant to an intended recipient, please notify the sender by replying to this message and then delete it from your system.  Use, dissemination, distribution, or reproduction of this message and/or any of its attachments (if any) by unintended recipients is not authorized and may be unlawful.


------=_NextPartTM-000-8a0d8329-b677-4409-9799-7ef6f63f2d98--