From be9081b621b26a244a54fd79325d0a64626c05fb Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 23 Jun 2012 12:40:39 +0000 Subject: FirstRun: plusified git-svn-id: http://svn.miranda-ng.org/main/trunk@546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FirstRun/main.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'plugins/FirstRun/main.cpp') diff --git a/plugins/FirstRun/main.cpp b/plugins/FirstRun/main.cpp index 206d2cd518..7799a9c474 100644 --- a/plugins/FirstRun/main.cpp +++ b/plugins/FirstRun/main.cpp @@ -4,17 +4,18 @@ HINSTANCE hInst; PLUGINLINK *pluginLink; HANDLE hModulesLoaded; int hLangpack; +struct MM_INTERFACE mmi; PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), "First Run Plugin", PLUGIN_MAKE_VERSION(0,0,0,2), - "Displays the Accounts window at the first start", + "Displays the Accounts window at the first start.", "Yasnovidyashii", "yasnovidyashii@gmail.com", "© 2008 Mikhail Yuriev", "http://miranda-im.org/", - 0, //not transient + UNICODE_AWARE, //not transient 0, //doesn't replace anything built-in // Generate your own unique id for your plugin. // Do not use this UUID! @@ -24,17 +25,18 @@ PLUGININFOEX pluginInfo={ int ModulesLoaded(WPARAM wParam,LPARAM lParam) { - char* ptszDllName; - char ptszDllPath[MAX_PATH]; + TCHAR* ptszDllName; + TCHAR ptszDllPath[MAX_PATH]; GetModuleFileName(hInst, ptszDllPath, MAX_PATH); - ptszDllName = _strlwr(strrchr(ptszDllPath, '\\')); + ptszDllName = _tcslwr(_tcsrchr(ptszDllPath, '\\')); if (ptszDllName!=NULL) ptszDllName=ptszDllName + 1; - CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL); - DBWriteContactSettingByte(NULL,"PluginDisable",ptszDllName,1); + CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL); + + DBWriteContactSettingByte(NULL, "PluginDisable", _T2A(ptszDllName), 1); return 0; } @@ -45,22 +47,21 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) return TRUE; } - -__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; } - -int __declspec(dllexport) Load(PLUGINLINK *link) +extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) { pluginLink=link; mir_getLP(&pluginInfo); + mir_getMMI(&mmi); hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded); return 0; } -int __declspec(dllexport) Unload(void) +extern "C" __declspec(dllexport) int Unload(void) { UnhookEvent(hModulesLoaded); return 0; -- cgit v1.2.3