Platform SDK: Exchange Server

HrStrWToStrA

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

Quick Info

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

HRESULT HrStrWToStrA(
  LPWSTR lpwszSource,  
  LPSTR * lppszDest    
);
 

Parameters

lpwszSource
Input parameter. Points to the Unicode source string.
lppszDest
Output parameter. Points to a pointer to the ANSI destination string.

Return Values

See Return Values.

Remarks

The HrStrWToStrA 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:

HrStrToStrA( LPTSTR lpszSource, LPSTR * lppszDest )

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

HrStrWToStr( LPWSTR lpwszSource, LPTSTR * lppszDest )

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

See Also

HrStrAToStrA, HrStrAToStrW, HrStrTokAll, HrStrWToStrW