Using Win32 functions in Visual FoxPro Image Gallery
Unicode and Character Set
..msdn
MultiByteToWideChar
WideCharToMultiByte
Code examples:
Converting Unicode data from the Clipboard to a character string using a given code page
Creating a unique filename based on existing filename
Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)
WideCharToMultiByte
..msdn    Add comment     W32 Constants      Translate this page
The WideCharToMultiByte function maps a wide-character string (Unicode) to a new character string.
Code examples:
Converting Unicode data from the Clipboard to a character string using a given code page
Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)
Creating a unique filename based on existing filename
Declaration:
int WideCharToMultiByte(
  UINT CodePage,            // code page
  DWORD dwFlags,            // performance and mapping flags
  LPCWSTR lpWideCharStr,    // wide-character string
  int cchWideChar,          // number of chars in string
  LPSTR lpMultiByteStr,     // buffer for new string
  int cbMultiByte,          // size of buffer
  LPCSTR lpDefaultChar,     // default for unmappable chars
  LPBOOL lpUsedDefaultChar  // set when default char used
);
FoxPro declaration:
DECLARE INTEGER WideCharToMultiByte IN kernel32;
    INTEGER   CodePage,;
    INTEGER   dwFlags,;
    STRING    lpWideCharStr,;
    INTEGER   cchWideChar,;
    STRING  @ lpMultiByteStr,;
    INTEGER   cbMultiByte,;
    STRING    lpDefaultChar,;
    INTEGER   lpUsedDefaultChar
Parameters:
CodePage
[in] Specifies the code page used to perform the conversion.

dwFlags
[in] Specifies the handling of unmapped characters.

lpWideCharStr
[in] Points to the wide-character string to be converted.

cchWideChar
[in] Specifies the number of wide characters in the string pointed to by the lpWideCharStr parameter.

lpMultiByteStr
[out] Points to the buffer to receive the translated string.

cbMultiByte
[in] Specifies the size, in bytes, of the buffer pointed to by the lpMultiByteStr parameter.

lpDefaultChar
[in] Points to the character used if a wide character cannot be represented in the specified code page.

lpUsedDefaultChar
[in] Points to a flag that indicates whether a default character was used.
Return value:
If the function succeeds, and cbMultiByte is nonzero, the return value is the number of bytes written to the buffer pointed to by lpMultiByteStr. The number includes the byte for the null terminator.
My comment:
FoxPro function StrConv() with Unicode support added in VFP7 makes this call redundant.
Word Index links for the WideCharToMultiByte :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2002-07-10 15:57:59
Modified: 2004-09-17 07:13:57
Visited in last 7 days: 26
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.35), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.167.184.64)
34 sec.Function: 'waveInStart'
2.8 min.Function: 'SHEmptyRecycleBin'
3.57 min.Function: 'RegCloseKey'
4.77 min.Function: 'SetFileAttributes'
4.83 min.Function: 'SetProp'
4.9 min.Function: 'SQLConnect'
5.32 min.Function: 'SHAddToRecentDocs'
5.58 min.Function: 'SetPrinter'
6.87 min.Function: 'WSAWaitForMultipleEvents'
Google
Advertise here!