We are going to show a PM sample program using the above two functions in Example of TrnsDt usage from 32-bit code (source: MISCWIN.C) and Example of WinCpTranslateString usage (source: MISCWIN.C). It converts a string from a PC code page to a host code page and returns a result to a modeless dialog box. First, the program displays a window for a user to input a target host code page and a string. The program automatically obtains the current code page of a PC using WinQueryCp (changed from WinGetCp). A string entered in the dialog box is converted to strings of a host code page using: