diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-23 01:35:02 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-07-23 01:35:02 +0000 |
commit | e6ccc491112a9183d7ed9249c17f5f00283b4bf5 (patch) | |
tree | 0aced8418166608471b6a22ff66c4977bf2728b5 /updater/updater.cpp | |
parent | 56e3be2de31fb7c0d41c04e162677b7b16c73df0 (diff) |
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
Diffstat (limited to 'updater/updater.cpp')
-rw-r--r-- | updater/updater.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 );
|