IEnumRfc1766::Next
A version of this page is also available for
4/8/2010
This method retrieves information about the specified number of locales in an array of RFC1766INFO structures.
Syntax
HRESULT Next(
ULONG celt,
PRFC1766INFO rgelt,
ULONG* pceltFetched
);
Parameters
- celt
[in] Number of RFC1766INFO structures the client wants returned. This parameter also specifies the number of RFC1766INFO elements for which the rgelt array has been allocated.
- rgelt
[out] Pointer to the array in which to return the RFC1766INFO 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 RFC1766INFO structures actually returned in the array pointed to by the rgelt parameter. This number 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 RFC1766INFO array has been successfully returned. |
S_FALSE |
No more 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 Locale Enumeration object has created to obtain the information it requests. The retrieved information begins with the locale at the enumerator object's current position in the enumeration sequence and continues until the bound celt is met or the end of the enumeration sequence is reached. If the end of the enumeration sequence is met in this process, the number of RFC1766INFO structures retrieved is returned in the pceltFetched parameter. The IEnumRfc1766::Next method also advances the position of the Locale Enumeration object in the enumeration sequence.
Example Code
The following code example shows a client retrieving the RFC1766INFO structures for the first ten locales in the enumeration sequence.
IEnumRfc1766* pEnumRfc1766 = NULL;
HRESULT hr = pMultiLanguage->EnumRfc1766(&pEnumRfc1766);
if(SUCCEEDED(hr))
{
PRFC1766INFO prfcInfo;
ULONG crfcInfo;
prfcInfo = (PRFC1766INFO) CoTaskMemAlloc(
sizeof(RFC1766INFO) * 10);
pEnumRfc1766->Next(10, pcpInfo, &crfcInfo);
// Operate on the information.
CoTaskMemRealloc((void*) prfcInfo,
sizeof(RFC1766INFO) * crfcInfo);
}
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 |