Partager via


IEnumCodePage::Next

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method retrieves an array of MIMECPINFO structures for the specified number of code pages.

Syntax

HRESULT Next( 
  ULONG celt,
  PMIMECPINFO rgelt,
  ULONG* pceltFetched
);

Parameters

  • celt
    [in] Number of MIMECPINFO structures the client wants returned. This parameter also specifies the number of MIMECPINFO elements for which the rgelt array has been allocated.
  • rgelt
    [out] Pointer to an array in which to return the MIMECPINFO structures. The calling application must free the array by using the task allocator.
  • pceltFetched
    [out] Pointer to an unsigned integer that receives the number of MIMECPINFO structures actually returned in the array pointed to by the rgelt parameter. The returned value can be smaller than the value specified in the celt parameter.

Return Value

The following table shows the possible return values for this method.

Value Description

S_OK

The MIMECPINFO array has been successfully returned.

S_FALSE

No more code page information is available; for example, the end of the enumeration sequence has been reached.

E_FAIL

There is an error in the arguments or an internal error has occurred.

Remarks

This method uses the enumeration sequence that the Code Page Enumeration object has created to obtain the code page information it requests. The retrieved information begins with the current position of the enumerator in the enumeration sequence and continues with the subsequent code pages until the bound celt is met or until the end of the enumeration sequence is reached. If the end of the enumeration sequence is met in this process, the number of MIMECPINFO structures retrieved is returned in the pceltFetched parameter. The IEnumCodePage::Next method also advances the position of the Code Page Enumeration object in the enumeration sequence.

Example Code

The following code example shows how to create and initialize a Code Page Enumeration object, allocate the memory for the rgelt array, and retrieve the MIMECPINFO structures for the first ten code pages in the system.

// pMultiLanguage - pointer to an IMultiLanguage interface.
IEnumCodePage* pEnumCodePage = NULL;
PMIMECPINFO pcpInfo;
ULONG ccpInfo;
HRESULT hr = pMultiLanguage->EnumCodePages(MIMECONTF_BROWSER,
    &pEnumCodePage);
if(SUCCEEDED(hr))
{
    pcpInfo = (PMIMECPINFO)CoTaskMemAlloc(sizeof(MIMECPINFO)*10);
    pEnumCodePage->Next(10, pcpInfo, &ccpInfo);
    // Perform operations with the information on the first ten
    // code pages.
    CoTaskMemRealloc((void*)pcpInfo, sizeof(MIMECPINFO)*ccpInfo);
}

Requirements

Header mlang.h, mlang.idl
Library mlang.dll
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later