Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CClientLazyCache::ClearPredictModuleHandles() const
- {
- FreeLibrary(m_predictDll);
- }
- bool CClientLazyCache::ReloadPredictModule()
- {
- CString sDirectory = GetModuleDirectory() + L"Predict_module.dll";
- if (PathFileExists(sDirectory) == FALSE)
- {
- MessageBox(nullptr, GetStr(IDS_LOAD_PREDICT_ERROR), GetStr(IDS_CLIENT_ERR_CAPTION), MB_OK);
- return false;
- }
- ClearPredictModuleHandles();
- m_predictDll = LoadLibrary(sDirectory);
- if (!m_predictDll)
- {
- DWORD dw = GetLastError();
- LPVOID lpMsgBuf;
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- nullptr,
- dw,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &lpMsgBuf,
- 0, nullptr);
- // Вывести сообщение об ошибке
- MessageBox(nullptr, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK | MB_ICONERROR);
- // Освободить буфер
- LocalFree(lpMsgBuf);
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement