Microsoft KB Archive/252627
Article ID: 252627
Article Last Modified on 8/25/2005
- Microsoft Messaging Application Programming Interface
This article was previously published under Q252627
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.
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.
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.
This behavior is by design.
The MultiByteToWideChar and WideCharToMultiByte functions can prove useful when using non-Unicode MAPI functions in a Unicode program.
Keywords: kbmsg kbprb KB252627