summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-14 14:47:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-14 14:47:56 +0000
commit662c4b333d83c70ae05fbcea2dd685e6a3524983 (patch)
tree6eeeb427b334025091d46b4b4944f9cfc5b81c27 /plugins
parent115e8a733f0e265f1197fb9a3b894ffa0af1aad8 (diff)
address logging for smileys
git-svn-id: http://svn.miranda-ng.org/main/trunk@6058 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.cpp2
-rw-r--r--plugins/SmileyAdd/src/SmileyBase.h23
-rw-r--r--plugins/SmileyAdd/src/general.h2
-rw-r--r--plugins/SmileyAdd/src/main.cpp8
4 files changed, 20 insertions, 15 deletions
diff --git a/plugins/SmileyAdd/src/SmileyBase.cpp b/plugins/SmileyAdd/src/SmileyBase.cpp
index badb6d43e8..f7ccf58106 100644
--- a/plugins/SmileyAdd/src/SmileyBase.cpp
+++ b/plugins/SmileyAdd/src/SmileyBase.cpp
@@ -61,6 +61,8 @@ ISmileyBase::ISmileyBase(void)
memset(&m_orect, 0, sizeof(m_orect));
regSmileys.insert(this);
+
+ mir_writeLogA(hLogger, "Possible crash address: %p\n", &m_visible);
}
ISmileyBase::~ISmileyBase(void)
diff --git a/plugins/SmileyAdd/src/SmileyBase.h b/plugins/SmileyAdd/src/SmileyBase.h
index f45b6d0a03..1e1c224d18 100644
--- a/plugins/SmileyAdd/src/SmileyBase.h
+++ b/plugins/SmileyAdd/src/SmileyBase.h
@@ -35,8 +35,8 @@ class ISmileyBase :
{
protected:
IOleAdviseHolder* m_spAdviseHolder;
- IAdviseSink* m_spAdviseSink;
- IOleClientSite* m_spClientSite;
+ IAdviseSink* m_spAdviseSink;
+ IOleClientSite* m_spClientSite;
DWORD m_advf;
LONG m_lRefCount;
@@ -48,7 +48,7 @@ protected:
HWND m_hwnd;
bool m_visible;
- bool m_dirAniAllow;
+ bool m_dirAniAllow;
public:
ISmileyBase(void);
@@ -60,7 +60,7 @@ public:
bool QueryHitPointSpecial(int x, int y, HWND hwnd, TCHAR** smltxt);
void SetHint(TCHAR* smltxt);
- virtual void SetPosition(HWND hwnd, LPCRECT lpRect);
+ virtual void SetPosition(HWND hwnd, LPCRECT lpRect);
//
// IUnknown members
@@ -94,16 +94,16 @@ public:
STDMETHOD(EnumAdvise)(IEnumSTATDATA **ppEnumAdvise);
STDMETHOD(GetMiscStatus)(DWORD dwAspect, DWORD *pdwStatus);
STDMETHOD(SetColorScheme)(LOGPALETTE* /* pLogpal */);
-
+
//
// IViewObject members
//
- STDMETHOD(SetAdvise)(DWORD aspect, DWORD advf, IAdviseSink* pAdvSink);
- STDMETHOD(GetAdvise)(DWORD* /*pAspects*/, DWORD* /*pAdvf*/, IAdviseSink** ppAdvSink);
- STDMETHOD(Freeze)(DWORD, long, void*, DWORD*);
- STDMETHOD(Unfreeze)(DWORD);
- STDMETHOD(GetColorSet)(DWORD, long, void*, DVTARGETDEVICE*, HDC,
- LOGPALETTE**);
+ STDMETHOD(SetAdvise)(DWORD aspect, DWORD advf, IAdviseSink* pAdvSink);
+ STDMETHOD(GetAdvise)(DWORD* /*pAspects*/, DWORD* /*pAdvf*/, IAdviseSink** ppAdvSink);
+ STDMETHOD(Freeze)(DWORD, long, void*, DWORD*);
+ STDMETHOD(Unfreeze)(DWORD);
+ STDMETHOD(GetColorSet)(DWORD, long, void*, DVTARGETDEVICE*, HDC,
+ LOGPALETTE**);
//
// IViewObject2 members
@@ -115,7 +115,6 @@ public:
//
STDMETHOD(SetTooltip)(BSTR bstrHint);
STDMETHOD(GetTooltip)(BSTR * bstrHint);
-
};
int CheckForTip(int x, int y, HWND hwnd, TCHAR** smltxt);
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h
index cb268cdfc7..4acc5095a7 100644
--- a/plugins/SmileyAdd/src/general.h
+++ b/plugins/SmileyAdd/src/general.h
@@ -90,7 +90,7 @@ typedef WCMatcher _TMatcher;
extern HINSTANCE g_hInst;
extern char* metaProtoName;
extern HANDLE hNetlibUser;
-extern HANDLE hEvent1;
+extern HANDLE hEvent1, hLogger;
extern HGENMENU hContactMenuItem;
extern SmileyCategoryListType g_SmileyCategories;
extern SmileyPackListType g_SmileyPacks;
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp
index f8ee1407a1..b9ac55fb91 100644
--- a/plugins/SmileyAdd/src/main.cpp
+++ b/plugins/SmileyAdd/src/main.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//globals
HINSTANCE g_hInst;
-HANDLE hEvent1;
+HANDLE hEvent1, hLogger;
HGENMENU hContactMenuItem;
char* metaProtoName;
@@ -89,7 +89,6 @@ extern "C" __declspec(dllexport) int Load(void)
if (ServiceExists(MS_SMILEYADD_REPLACESMILEYS)) {
ReportError(TranslateT("Only one instance of SmileyAdd could be executed.\nRemove duplicate instances from 'Plugins' directory"));
-
return 1;
}
@@ -99,6 +98,11 @@ extern "C" __declspec(dllexport) int Load(void)
opt.Load();
+ // initialize log
+ TCHAR szLogFileName[MAX_PATH];
+ mir_sntprintf(szLogFileName, MAX_PATH, _T("%s\\smiley.log"), VARST(_T("%miranda_profile%")));
+ hLogger = mir_createLog("smileys", _T("Crash log"), szLogFileName, 0);
+
// create smiley events
hEvent1 = CreateHookableEvent(ME_SMILEYADD_OPTIONSCHANGED);