Partager via


IMLangCodePages::CodePagesToCodePage (Windows CE 5.0)

Send Feedback

This method retrieves the identifier value for a code page in the given set of code pages.

HRESULTCodePagesToCodePage(DWORDdwCodePages,UINTuDefaultCodePage,UINT* puCodePage);

Parameters

  • dwCodePages
    [in] Specifies the source set of code pages.
  • uDefaultCodePage
    [in] Default code page to look for in the set.
  • puCodePage
    [out] Pointer to an unsigned integer where the code page identifier value is returned.

Return Values

Returns S_OK if successful or E_FAIL if an error occurs.

Remarks

For more information about sets of code pages, see IMLangCodePages.

If the code page specified by the uDefaultCodePage parameter is in the set of code pages specified by the dwCodePages parameter, the method returns the value of the uDefaultCodePage parameter. If no default code page is given, the method returns the code page identifier value corresponding to the least significant bit that has been set to 1. For example, if the value of the dwCodePages parameter is 0x1e0000, and the value of the uDefaultCodePage parameter is not in the set, the method returns the code page that corresponds to the bit 0x020000.

Example Code

The following example shows the syntax for converting a set of code pages into an array of corresponding MIMECPINFO structures.

// dwCodePages - DWORD representing a set of code pages.
// pcpInfo - caller-allocated array of MIMECPINFO structures.
// pMultiLanguage - pointer to an IMultiLanguage interface.
// pMLangCodePages - pointer to an IMLangCodePages interface.
for(int i = 0; dwCodePages; i++)
{
    UINT uCodePage;
    DWORD dwTemporaryCodePages;
    pMLangCodePages->CodePagesToCodePage(dwCodePages, CP_ACP,
        &uCodePage);
    pMultiLanguage->GetCodePageInfo(uCodePage, pcpInfo + i);
    pMLangCodePages->CodePageToCodePages(uCodePage,
        &dwTemporaryCodePages);
    dwCodePages &= ~dwTemporaryCodePages;
}

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Mlang.h, Mlang.idl.
Link Library: Mlang.dll.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.