Microsoft KB Archive/252627

= PRB: MAPI_E_BAD_CHARWIDTH When Passing MAPI_UNICODE To MAPI Functions =

Article ID: 252627

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Messaging Application Programming Interface

-



This article was previously published under Q252627



SYMPTOMS
The documentation for many MAPI functions states that MAPI_UNICODE is an acceptable flag, yet some functions, such as the MAPIAdminProfiles function, return MAPI_E_BAD_CHARWIDTH if this flag is used.



CAUSE
The documentation for these MAPI functions only requires that they accept MAPI_UNICODE as a flag, not that they implement Unicode. Functions that return MAPI_E_BAD_CHARWIDTH do not support Unicode. All strings passed in and out of these functions must be ANSI strings.



RESOLUTION
If a MAPI function returns MAPI_E_BAD_CHARWIDTH when MAPI_UNICODE is passed, do not pass this flag. All Unicode strings must be converted to ANSI before being passed to these functions, and all strings returned are not ANSI.



STATUS
This behavior is by design.



MORE INFORMATION
The MultiByteToWideChar and WideCharToMultiByte functions can prove useful when using non-Unicode MAPI functions in a Unicode program.

Keywords: kbmsg kbprb KB252627

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.