[Enterprise Extensions only]

CORBA::wstring_dup

Overview Copies a WString.
Original class CORBA


Intended Usage

This method is intended to be used by client and server applications to duplicate (copy) data of type CORBA::WString. The resulting string should be subsequently freed using CORBA::wstring_free(). If the input value is NULL, the return value is NULL.

WStrings to be passed on remote method invocations or whose ownership is to be transferred from one library to another should be allocated using this method or CORBA::wstring_alloc() rather than the C++ new[ ] operator. This ensures that string memory is deleted using the same C++ run time that originally allocated it.

IDL Syntax

  static wchar_t* * wstring_dup(const wchar_t* * str);

Input parameters

str
The NULL-terminated WString to be copied.

Return values

wchar_t*
A copy of the input WString. This storage should be subsequently freed using CORBA::wstring_free() rather than the C++ delete[ ] operator. NULL is returned if the storage cannot be allocated.

Example

See the example for the CORBA::wstring_alloc method.