IEnumCodePage::Clone Meth...     IEnumCodePage::Reset Meth...     IEnumCodePage Interface    
Web Workshop (Miscellaneous)

IEnumCodePage::Next 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 would like returned. The celt parameter also specifies the number of MIMECPINFO elements for which the rgelt array has been allocated.
rgelt
[out] Address of an array in which to return the MIMECPINFO structures. The calling application must free the array by using the task allocator.
pceltFetched
[out] Address of a value that receives the number of MIMECPINFO structures actually returned in rgelt. The returned value may be smaller than the value specified in the celt parameter.

Return Value

Returns one of the following values:

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. Next also advances the position of the Code Page Enumeration Object in the enumeration sequence.

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0

Example

This example demonstrates 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 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);
}

See Also

IEnumCodePage::Reset, IEnumCodePage::Skip, IMultiLanguage::EnumCodePages



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.