Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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

Syntax

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

Parameters

celt

[in] Number of MIMECPINFOstructures the client wants returned. This parameter also specifies the number of MIMECPINFOelements for which the rgeltarray has been allocated.

rgelt

[out] Pointer to an array in which to return the MIMECPINFOstructures. The calling application must free the array by using the task allocator.

pceltFetched

[out] Pointer to an unsigned integer that receives the number of MIMECPINFOstructures actually returned in the array pointed to by the rgeltparameter. The returned value can be smaller than the value specified in the celtparameter.

Return Value

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

Value Description

S_OK

The MIMECPINFOarray 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 celtis 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 MIMECPINFOstructures retrieved is returned in the pceltFetchedparameter. The IEnumCodePage::Nextmethod 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 rgeltarray, and retrieve the MIMECPINFOstructures for the first ten code pages in the system.

Copy Code
// 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