diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 3adba1c15..db8dbe2d1 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -87,20 +87,45 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath, vectorisx64()) + throw generic_string(TEXT("This plugin is in 32-bit, whereas your Notepad++ is in 64-bit.")); + } + break; + + case SCS_64BIT_BINARY: + { + if (not nppParams->isx64()) + throw generic_string(TEXT("This plugin is in 64-bit, whereas your Notepad++ is in 32-bit.")); + } + break; + + default: + throw generic_string(TEXT("It's not a windows standard dll.")); + } + } pi->_moduleName = PathFindFileName(pluginFilePath); - pi->_hLib = ::LoadLibrary(pluginFilePath); - if (!pi->_hLib) - { - const std::wstring& lastErrorMsg = GetLastErrorAsString(); - if (lastErrorMsg.empty()) - throw generic_string(TEXT("Load Library is failed.\nMake \"Runtime Library\" setting of this project as \"Multi-threaded(/MT)\" may cure this problem.")); - else - throw generic_string(lastErrorMsg.c_str()); - } + pi->_hLib = ::LoadLibrary(pluginFilePath); + if (!pi->_hLib) + { + const std::wstring& lastErrorMsg = GetLastErrorAsString(); + if (lastErrorMsg.empty()) + throw generic_string(TEXT("Load Library is failed.\nMake \"Runtime Library\" setting of this project as \"Multi-threaded(/MT)\" may cure this problem.")); + else + throw generic_string(lastErrorMsg.c_str()); + } pi->_pFuncIsUnicode = (PFUNCISUNICODE)GetProcAddress(pi->_hLib, "isUnicode"); if (!pi->_pFuncIsUnicode || !pi->_pFuncIsUnicode()) @@ -157,8 +182,6 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath, vector