From eb3076751d679ceadfdeeec6fc74dc9fd2cd23fe Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Thu, 11 Dec 2008 01:13:32 +0000 Subject: Added error message on pre 0.8 Miranda version Disabled loading for pre 0.8 Miranda version Cleanup of mmi initialization code git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@433 4f64403b-2f21-0410-a795-97e2b3489a10 --- metacontacts/meta_main.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'metacontacts/meta_main.c') diff --git a/metacontacts/meta_main.c b/metacontacts/meta_main.c index f8184e0..62db9ba 100644 --- a/metacontacts/meta_main.c +++ b/metacontacts/meta_main.c @@ -87,8 +87,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Use VersionNo.h to set the version number, and ensure resource file is not open #include "version.h" -struct MM_INTERFACE memoryManagerInterface; - +struct MM_INTERFACE mmi; BOOL os_unicode_enabled = FALSE; //! Information gathered by Miranda, displayed in the plugin pane of the Option Dialog @@ -117,13 +116,11 @@ HANDLE metaMainThread; //!< Duplicate of thread handle */ __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { - return mirandaVersion < PLUGIN_MAKE_VERSION(0,8,0,0) ? NULL : &pluginInfo; -} - -__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) -{ - pluginInfo.cbSize = sizeof(PLUGININFO); - return (PLUGININFO*)&pluginInfo; + if ( mirandaVersion < PLUGIN_MAKE_VERSION( 0, 8, 0, 0 )) { + MessageBox( NULL, _T("The MetaContacts cannot be loaded. It requires Miranda IM 0.8.0.0 or later."), _T("Miranda"), MB_OK|MB_ICONWARNING|MB_SETFOREGROUND|MB_TOPMOST ); + return NULL; + } + return &pluginInfo; } static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_METACONTACTS, MIID_LAST}; @@ -174,8 +171,7 @@ int __declspec(dllexport)Load(PLUGINLINK *link) pluginLink=link; DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &metaMainThread, THREAD_SET_CONTEXT, FALSE, 0 ); - memoryManagerInterface.cbSize = sizeof(memoryManagerInterface); - CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&memoryManagerInterface); + mir_getMMI(&mmi); os_unicode_enabled = IsUnicodeOS(); -- cgit v1.2.3