HrStrAToStrW

The HrStrAToStrW function creates a copy of an ANSI string as a Unicode string using the MAPI MAPIAllocateBuffer function.

Quick Info

Header file: EDKUTILS.H
Library: EDKUTILS.LIB
Unicode: (see Remarks)

HRESULT HrStrAToStrW(
  LPSTR lpszSource,    
  LPWSTR * lppwszDest  
);
 

Parameters

lpszSource
Input parameter. Points to an ANSI source string.
lppwszDest
Output parameter. Points to a pointer to the Unicode destination string.

Return Values

See Return Values.

Remarks

The HrStrAToStrW function is useful for creating macros involving TCHAR strings. You must release the destination string buffer with the MAPI MAPIFreeBuffer function before your routine exits.

When Unicode is defined, the following macros are defined as this function:

HrStrAToStr( LPSTR lpszSource, LPTSTR * lppszDest )

When Unicode is undefined, the following macros are defined as this function:

HrStrAToStrW( LPSTR lpszSource, LPWSTR * lppwszDest )

For information about the MAPIAllocateBuffer and MAPIFreeBuffer functions, see the MAPI Programmer's Reference.

See Also

HrStrAToStrA, HrStrTokAll, HrStrWToStrA, HrStrWToStrW