IEnumCodePage::Next method

Gets an array of MIMECPINFO structures for the specified number of code pages.

Syntax

HRESULT Next(
  [in]  unsigned long celt,
  [out] PMIMECPINFO   rgelt,
  [out] unsigned long *pceltFetched
);

Parameters

  • celt [in]
    The number of MIMECPINFO structures the client wants to return. The celt parameter also specifies the number of MIMECPINFO elements for which the rgelt array has been allocated.

  • rgelt [out]
    A 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]
    A pointer to a unsigned integer that receives the number of MIMECPINFO structures actually returned in rgelt. The returned value can be smaller than the value specified in the celt parameter.

Return value

Returns one of the following values.

Return code 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 get the code page information that 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. IEnumCodePage::Next also advances the position of the Code Page Enumeration Object in the enumeration sequence.

Examples

This example demonstrates how to create and initialize a Code Page Enumeration Object, allocate the memory for the rgelt array, and get the MIMECPINFO structures for the first 10 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 10
    // code pages.

    CoTaskMemRealloc((void*)pcpInfo, sizeof(MIMECPINFO)*ccpInfo);
}

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mlang.h

IDL

Mlang.idl

DLL

Mlang.dll

See also

IEnumCodePage

Reference

Reset

Skip

EnumCodePages