source: trunk/MFCtooling/userlog/userlog.h @ 2180

Last change on this file since 2180 was 162, checked in by sherbold, 13 years ago
  • there is no longer a default log-format selected in the userlog.h, e.g., through #DEFINE USING_COSTUMLOG. The log format has to be choosen using compile parameters.
File size: 1.6 KB
RevLine 
[162]1#ifndef __USERLOG_H__
2#define __USERLOG_H__
[48]3
[32]4#ifdef USERLOG_EXPORTS
5#define USERLOG_API __declspec(dllexport)
6#else
7#define USERLOG_API __declspec(dllimport)
8#endif
9
10#include <iostream>
11#include <fstream>
12
13
14
15//#define __USING_MTRACE__
[162]16//#define __USING_COSTUMLOG__
17//#define __INCLUDEHOOKINFO__
[32]18//#define __TIMING__
[162]19//#define __ENCODE_BASE64__
[32]20
21#define LOGPREFIX " UL: "
22#define LOGPREFIXCONT " ULC: "
23#define LOGPREFIXWSTRING L" UL: "
24
25#define NUMHOOKS 2
26
27#define CALLWNDHOOKID 0
28#define GETMSGHOOKID 1
29
30#ifdef __USING_COSTUMLOG__
31#define LOGFILE "usagelog.txt"
32#endif
33
34typedef struct _HOOKDATA {
35        int nType;
36        HOOKPROC hkproc;
37        HHOOK hookhandle;
38        bool active;
39} HOOKDATA;
40
41HOOKDATA myhookdata[NUMHOOKS];
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**
48 * API function that starts the logging of messages.
49 * All required hooks and logging mechanisms are initialized.
50 */
51USERLOG_API void __cdecl InitUsagelog();
52
53/**
54 * API function that stopts the logging of messages.
55 * All existing hooks are released and if required, logging mechnisms are stopped.
56 */
57USERLOG_API void __cdecl ReleaseUsagelog();
58
59#ifdef __cplusplus
60} // extern "C"
61#endif
62
63
64void InitHookdata();
65
66void InitHooks();
67
68void ReleaseHooks();
69
70
71LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam);
72
73LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam);
74
75void HookProc(int nFrom, int nCode, PMSG msg);
76
77void WriteLogentryWString(PMSG msg, int nFrom);
78
79#ifdef __USING_COSTUMLOG__
80void InitLogfile();
81
82void CloseLogfile();
[48]83#endif
84
85#endif // __USERLOG_H__
Note: See TracBrowser for help on using the repository browser.