Valera241176 wrote: How to get them to translate from Unicode to ANSI using WideCharToMultiByte? You have to use WideCharToMultiByte twice, one to know the size needed and one to do the transformation. LPWSTR lpszMsg; [...] // First calculation of the size needed to store the converted string int iCharSize = WideCharToMultiByte(CODE_PAGE, 0, lpszMsg, -1, NULL, 0, NULL, NULL); // Alloc a ANSI string LPSTR formatANSI = (LPSTR) HeapAlloc(GetProcessHeap(), 0, sizeof(char) * iCharSize); // convert WideCharToMultiByte(CODE_PAGE, 0, lpszMsg, -1, formatANSI, iCharSize, NULL, NULL); //... // use FormatAnsi there //... // Free the ANSI string HeapFree(GetProcessHeap(), 0, formatANSI); HTH, K.
Angels banished from heaven have no choice but to become demons Cowboy Bebop