From ded569242b7cf4ba2aed1055797c55e680168897 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 29 Aug 2013 19:34:05 +0000 Subject: log initialization moved to DllMain git-svn-id: http://svn.miranda-ng.org/main/trunk@5882 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ShellExt/src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/ShellExt') diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index b7b66556e6..08050b22ea 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -3,6 +3,8 @@ HINSTANCE hInst; int hLangpack; +static TCHAR tszLogPath[MAX_PATH]; + PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -20,6 +22,9 @@ PLUGININFOEX pluginInfoEx = { BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) { + GetTempPath(SIZEOF(tszLogPath), tszLogPath); + _tcscat_s(tszLogPath, SIZEOF(tszLogPath), _T("shlext.log")); + hInst = hinstDLL; DisableThreadLibraryCalls(hinstDLL); } @@ -108,8 +113,6 @@ STDAPI DllUnregisterServer() ///////////////////////////////////////////////////////////////////////////////////////// -static TCHAR tszLogPath[MAX_PATH]; - void logA(const char *format, ...) { FILE *out = _tfopen(tszLogPath, _T("a+")); @@ -126,9 +129,6 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfoEx); - GetTempPath(SIZEOF(tszLogPath), tszLogPath); - _tcscat_s(tszLogPath, SIZEOF(tszLogPath), _T("shlext.log")); - InvokeThreadServer(); HookEvent(ME_OPT_INITIALISE, OnOptionsInit); DllRegisterServer(); -- cgit v1.2.3