Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets a list of the languages in which metadata is available.
HRESULT GetAllLanguages(
[out] PROPVARIANT *ppvLanguages
);
[out] ppvLanguages
A pointer to a PROPVARIANT that receives the list of languages. The list is returned as an array of null-terminated wide-character strings. Each string in the array is an RFC 1766-compliant language tag.
The returned PROPVARIANT type is VT_VECTOR | VT_LPWSTR. The list might be empty, if no language tags are present. The caller must free the PROPVARIANT by calling PropVariantClear.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
For more information about language tags, see RFC 1766, "Tags for the Identification of Languages".
To set the current language, call IMFMetadata::SetLanguage.
The following example shows how to get the list of language tags and enumerate the list.
HRESULT DisplayLanguageList(IMFMetadata *pMetadata)
{
PROPVARIANT varLangs;
HRESULT hr = pMetadata->GetAllLanguages(&varLangs);
if (SUCCEEDED(hr))
{
if (varLangs.vt == (VT_VECTOR | VT_LPWSTR))
{
for (ULONG i = 0; i < varLangs.calpwstr.cElems; i++)
{
wprintf(L"%s\n", varLangs.calpwstr.pElems[i]);
}
}
else
{
hr = E_UNEXPECTED;
}
PropVariantClear(&varLangs);
}
return hr;
}
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | mfidl.h |
Library | Mfuuid.lib |
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in