From 63ca8bdac66f5b91d22bff6ea5b649aea8b8f1f9 Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 2 Jul 2007 05:52:03 +0000 Subject: allow for multiple accounts (module name from filename - ala dll copy) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@240 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/MySpace.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'MySpace/MySpace.cpp') diff --git a/MySpace/MySpace.cpp b/MySpace/MySpace.cpp index c06690d..e9c9276 100644 --- a/MySpace/MySpace.cpp +++ b/MySpace/MySpace.cpp @@ -16,6 +16,8 @@ PLUGINLINK *pluginLink; HANDLE mainThread; int code_page; +char MODULE[256]; + PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -116,6 +118,22 @@ extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) { code_page = (int)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); + + // Get module name from DLL file name + { + char* str1; + char str2[MAX_PATH]; + + GetModuleFileNameA(hInst, str2, MAX_PATH); + str1 = strrchr(str2, '\\'); + if (str1 != NULL && strlen(str1+1) > 4) { + strncpy(MODULE, str1+1, strlen(str1+1)-4); + MODULE[strlen(str1+1)-3] = 0; + } + CharUpperA(MODULE); + } + + if(ServiceExists(MS_DB_SETSETTINGRESIDENT)) { // 0.6+ char buff[256]; mir_snprintf(buff, 256, "%s/%s", MODULE, "Status"); -- cgit v1.2.3