Function _conToAnsiCp() Foundation

Converts an OEM string to an ANSI string.

Syntax
XPPAPIRET XPPAPIENTRY _conToAnsiCp(CHAR *strAnsi,
                                   const CHAR *strOem,
                                   ULONG oemLength);
Parameters
CHAR* strAnsi
Pointer to a string which will contain the ANSI string.
CHAR* strOem
Pointer to the OEM string that is to be converted to an ANSI character set.
ULONG oemLength
The length of the OEM character string that is to be converted.
Return

If the string could be converted, NULL is returned. Otherwise the error which occurred is indicated by the return value (see the XPP_ERR_... macros).

Description

The function _conToAnsiCp is used to convert a string from an OEM to an ANSI character set.

Examples
#include <windows.h> 

#include "xppdef.h" 
#include "xpppar.h" 
#include "xppcon.h" 

XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList) 
{  /* Declare and initialize variables */ 
ContainerHandle chResult; 
char cString[20]; 
int i; 

for(i=0;i<20;cString[i++]=0); 

if( _conToAnsiCp( cString, "äöüß", 4 )) 
{ /* Error handling... */ 
} 

chResult = _conPutC( NULLCONTAINER, cString ); 

_conReturn( paramList, chResult ); 
} 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.