All Manuals > LispWorks Foreign Language Interface User Guide and Reference Manual > 4 Advanced Uses of the FLI > 4.2 Modifying, passing and returning strings

NextPrevUpTopContentsIndex

4.2.8 Win32 API functions that handle strings

Functions in the Win32 API that handle strings come in two flavors, one for ANSI strings and one for Unicode strings. Windows ME only supports the ANSI functions but Windows XP/Vista/7 support both. The functions are named with a single letter suffix, an A for the ANSI functions and a W for the Unicode functions. So for example both CreateFileA and CreateFileW exist. In C, this is finessed by the use of #define in the header files.

There are two ways to handle this:

In either case, as well as calling the correct function, you must encode/decode any string arguments/results correctly, to match the A or W in the function name. The foreign types win32:tstr , win32:lpctstr and win32:lptstr correspond to the typical ones found in the Win32 API. For more information about these foreign types, see their manual pages in the LispWorks User Guide and Reference Manual .


LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011

NextPrevUpTopContentsIndex