Help Center

DWSTRING.wcharmethod

Returns the string data as a new unicode string allocated with **CoTaskMemAlloc**.

String ManagementmethodDWSTRING.incdocumented

Syntax

FUNCTION wchar () AS WSTRING PTR

Description

Returns the string data as a new unicode string allocated with CoTaskMemAlloc.

Useful when we need to pass a pointer to a null terminated wide string to a function or method that will release it. If we pass a WSTRING it will GPF. If the length of the input string is 0, CoTaskMemAlloc allocates a zero-length item and returns a valid pointer to that item. If there is insufficient memory available, CoTaskMemAlloc returns NULL.

Reference

  • Include file DWSTRING.inc
  • Defined in AfxNova/DWSTRING.inc:766
  • Documented in String Management/DWSTRING Class.md
  • Topic: DWSTRING Class