Navigation:  Tutorial >

The "A" and "W" sufixes in WinAPI exported functions

Previous pageReturn to chapter overviewNext page

With the introduction of the Unicode support in the WinAPI was start the need  to warranty the compatibility with applications using the ANSI character set. For this purpose the major part of the WinAPI functions using character strings have a duplicate implementation one for ANSI and the other for Unicode.

 

 

Functions that provide both Unicode and ANSI implementations, usually have the suffix  "A" for the ANSI implementation and "W" for the Unicode  ( also called Wide) implementation. In the windows header files functions without suffix are mapped to the corresponding suffixed version with the "W" suffix if the UNICODE is defined or suffixed with "A" if UNICODE not defined.

 

In the WinAPI documentation you will found the function prototypes without the suffix, and usually in the lasts paragraphs of the function topic will explain if there are 2 separate implementations for Unicode and ANSI character sets.

 

Xbase++ uses the ANSI character set, so you must use the  "A" version of the WinAPI functions involving strings when available or transform the strings to/from Unicode in the few cases where the ANSI implementation is not provided.

 

You can use the Dependency Walker tool (http://www.dependencywalker.com) to generate the list of function names exported by a DLL.