GENERIC_SERVER  0.0.0.9
A light-weight, cross-platform, pluggable, extensible and secure framework for deploying C++ plug-ins.
 All Classes Files Functions Variables Typedefs Pages
XEventLog.h
1 // XEventLog.h Version 1.0
2 //
3 // Author: Hans Dietrich
4 // hdietrich2@hotmail.com
5 //
6 // This software is released into the public domain.
7 // You are free to use it in any way you like.
8 //
9 // This software is provided "as is" with no expressed
10 // or implied warranty. I accept no liability for any
11 // damage or loss of business that this software may cause.
12 //
14 #ifdef WINDOWS
15 #ifndef XEVENTLOG_H
16 #define XEVENTLOG_H
17 
18 class CXEventLog
19 {
20 // Construction
21 public:
22  CXEventLog(LPCTSTR lpszApp = NULL, LPCTSTR lpszEventMessageDll = NULL);
23  ~CXEventLog();
24 
25 // Attributes
26 public:
27  LPTSTR GetAppName();
28 
29 // Operations
30 public:
31  void Close();
32  BOOL Init(LPCTSTR lpszApp, LPCTSTR lpszEventMessageDll = NULL);
33  BOOL Write(WORD wType, LPCTSTR lpszMessage);
34 
35 // Implementation
36 protected:
37  HANDLE m_hEventLog;
38  LPTSTR m_pszAppName;
39  PSID GetUserSid();
40  BOOL RegisterSource(LPCTSTR lpszApp, LPCTSTR lpszEventMessageDll);
41  void SetAppName(LPCTSTR lpszApp);
42 };
43 
44 #endif //XEVENTLOG_H
45 #endif