MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / CConfig

Method CConfig

windows/APIExample/APIExample/CConfig.cpp:9–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7}
8
9CConfig::CConfig()
10{
11 TCHAR szZhConfigFile[MAX_PATH] = { 0 };
12 TCHAR szEnConfigFile[MAX_PATH] = { 0 };
13 ::GetModuleFileName(NULL, szZhConfigFile, MAX_PATH);
14 LPTSTR lpLastSlash = _tcsrchr(szZhConfigFile, _T('\\')) + 1;
15 *lpLastSlash = 0;
16 m_strZhConfigFile = szZhConfigFile;
17 m_strZhConfigFile += _T("zh-cn.ini");
18
19 if (::GetFileAttributes(m_strZhConfigFile) == INVALID_FILE_ATTRIBUTES) {
20 HANDLE hFile = ::CreateFile(m_strZhConfigFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
21 ::CloseHandle(hFile);
22 }
23
24 ::GetModuleFileName(NULL, szEnConfigFile, MAX_PATH);
25 LPTSTR lpLastSlashEn = _tcsrchr(szEnConfigFile, _T('\\')) + 1;
26 *lpLastSlashEn = 0;
27 m_strEnConfigFile = szEnConfigFile;
28 m_strEnConfigFile += _T("en.ini");
29
30 if (::GetFileAttributes(m_strEnConfigFile) == INVALID_FILE_ATTRIBUTES) {
31 HANDLE hFile = ::CreateFile(m_strEnConfigFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
32 ::CloseHandle(hFile);
33 }
34 LCID lcid = GetUserDefaultLCID();//LCID https://www.science.co.il/language/Locale-codes.php
35 if (lcid == 2052) {//chinese
36 m_bChinese = true;
37 }
38
39}
40
41
42CConfig::~CConfig()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected