summaryrefslogtreecommitdiff
path: root/MySpace/MySpace.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-02 05:52:03 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-02 05:52:03 +0000
commit63ca8bdac66f5b91d22bff6ea5b649aea8b8f1f9 (patch)
tree7577e876dae0a2580f321f3fc9e4da5195cc0168 /MySpace/MySpace.cpp
parent2beea6e387b2ea45634f7b11ab33ca60bb9c7bb0 (diff)
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
Diffstat (limited to 'MySpace/MySpace.cpp')
-rw-r--r--MySpace/MySpace.cpp18
1 files changed, 18 insertions, 0 deletions
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");