From e6ccc491112a9183d7ed9249c17f5f00283b4bf5 Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 23 Jul 2007 01:35:02 +0000 Subject: added check for correct version - ansi or unicode git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@301 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/updater.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'updater/updater.cpp') diff --git a/updater/updater.cpp b/updater/updater.cpp index aa7aabe..c5d19a7 100644 --- a/updater/updater.cpp +++ b/updater/updater.cpp @@ -85,6 +85,7 @@ void DeinitNetlib() { HANDLE hEventIdleChanged; int ModulesLoaded(WPARAM wParam, LPARAM lParam) { + LoadOptions(); /* @@ -221,6 +222,28 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { pluginLink = link; + char szVer[128]; + bool unicode_system = (CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVer), (LPARAM)szVer) == 0 && strstr(szVer, "Unicode")); +#ifdef _UNICODE + if(!unicode_system) { + TCHAR fp[256], *fn; + GetModuleFileName(hInst, fp, 256); + fn = _tcsrchr(fp, '\\'); + if(fn) fn++; + MessageBox(0, TranslateT("You are using the wrong version of this plugin.\nPlease download the NON-UNICODE version.\nPlugin disabled."), fn, MB_OK); + return 1; + } +#else + if(unicode_system) { + TCHAR fp[256], *fn; + GetModuleFileName(hInst, fp, 256); + fn = _tcsrchr(fp, '\\'); + if(fn) fn++; + MessageBox(0, TranslateT("You are using the wrong version of this plugin.\nPlease download the UNICODE version.\nPlugin disabled."), fn, MB_OK); + return 1; + } +#endif + mainThreadId = GetCurrentThreadId(); DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 ); -- cgit v1.2.3