| 59 | } |
| 60 | |
| 61 | void LoadLangDll() |
| 62 | { |
| 63 | if (g_langid != g_ShellCache.GetLangID() && (g_langTimeout == 0 || g_langTimeout < GetTickCount64())) |
| 64 | { |
| 65 | g_hResInst = g_hmodThisDll; // reset to English defaults, because CLangDll.Init() unloads the DLL |
| 66 | if (HINSTANCE hInst = g_langDll.Init(L"TortoiseProc", g_hmodThisDll, g_ShellCache.GetLangID()); hInst) |
| 67 | { |
| 68 | g_hResInst = hInst; |
| 69 | g_langid = g_langDll.GetLoadedLangId(); |
| 70 | g_langTimeout = 0; |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | // either the dll for the selected language is not present, or |
| 75 | // it is the wrong version. |
| 76 | // fall back to English and set a timeout so we don't retry |
| 77 | // to load the language dll too often |
| 78 | g_hResInst = g_hmodThisDll; |
| 79 | g_langid = CLangDll::s_defaultLang; |
| 80 | // set a timeout of 10 seconds |
| 81 | if (g_ShellCache.GetLangID() != CLangDll::s_defaultLang) |
| 82 | g_langTimeout = GetTickCount64() + 10000; |
| 83 | } // if (g_langid != g_ShellCache.GetLangID()) |
| 84 | } |
| 85 | |
| 86 | STDMETHODIMP CShellExt::QueryInterface(REFIID riid, LPVOID FAR *ppv) |
| 87 | { |
no test coverage detected