本文整理汇总了C++中CLanguage::LoadLanguage方法的典型用法代码示例。如果您正苦于以下问题:C++ CLanguage::LoadLanguage方法的具体用法?C++ CLanguage::LoadLanguage怎么用?C++ CLanguage::LoadLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLanguage
的用法示例。
在下文中一共展示了CLanguage::LoadLanguage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ListLanguages
void CSelectLanguageDlg::ListLanguages(CString sLanguageFolder)
{
// Declare variables
WIN32_FIND_DATA wfd;
HANDLE hFile;
CString sFile;
CString sSpec = sLanguageFolder + _T("*.xml");
CString sPathFile;
CLanguage * pLanguage = CLanguage::Instance();
CFunctions * pFunctions = CFunctions::Instance();
CPath * pPath = CPath::Instance();
LanguageType oLangType;
// Find the first file
hFile = FindFirstFile(sSpec, &wfd);
if (hFile != INVALID_HANDLE_VALUE)
{
do
{
// Get file info
sFile = wfd.cFileName;
sPathFile = sLanguageFolder + sFile;
// Get language info
if (pLanguage->LoadLanguage(sPathFile, _T(""), false))
{
// Check if it is the right version
if (pFunctions->CompareVersions(pLanguage->GetLanguageVersion(), VERSION_LANGUAGE) != COMPAREVERSION_FIRSTSMALLER)
{
// Add to list of languages
oLangType.sFilename = pPath->StripFileExtension(pPath->ExtractFileName(sPathFile));
oLangType.sDescription = pLanguage->GetLanguageName();
m_arrLanguages[m_iLanguageCount++] = oLangType;
}
}
}
while (FindNextFile(hFile, &wfd));
// Close handle to file
FindClose(hFile);
}
// Release last language
pLanguage->ReleaseLanguage();
}