Beispielprogramm zur Verwendung der DLL logtext.dll - logtextexample
Dieses Beispiel zeigt, wie die Bibliothek in eigene Applikationen implementiert
und aufgerufen wird.
logtext.hgehe zur Dokumentation dieser Datei00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <io.h>
00014 #include <windows.h>
00015
00016 #ifndef _logtext_h__now_included
00017 #define _logtext_h__now_included
00018
00019 #define DllImport __declspec( dllimport )
00020 #define DllExport __declspec( dllexport )
00021
00022 extern DllExport char *chCurrentDateTimeText;
00023 extern DllExport char *chCurrentDateWeekText;
00024 extern DllExport char *chCurrentLogFileName;
00025 extern DllExport char *chCurrentDateNoBlanks;
00026 extern DllExport char *chCurrentDateWeek;
00027 extern DllExport char *chCurrentDTMSText;
00028
00029 #define MAX_DATE_TIME_TEXT 26
00030 #define MAX_DATE_WEEK_TEXT 11
00031 #define MAX_DATE_NO_BLANKS 8
00032 #define MAX_DATE_WEEK 6
00033 #define MAX_DTMS_TEXT 30
00034
00035 typedef struct sCurrentDateTime
00036 {
00037 char chCurrentDateTimeText[MAX_DATE_TIME_TEXT + 1];
00038 char chCurrentDateWeekText[MAX_DATE_WEEK_TEXT + 1];
00039 char chCurrentDateNoBlanks[MAX_DATE_NO_BLANKS + 1];
00040 char chCurrentDateWeek[MAX_DATE_WEEK + 1];
00041 char chCurrentDTMSText[MAX_DTMS_TEXT + 1];
00042 } SCURRENTDATETIME;
00043
00044
00045 typedef struct sLogTextEx
00046 {
00047 DWORD dwOptions;
00048 DWORD dwExOptions;
00049 unsigned long ul_LO_QUICK_Counter;
00050 unsigned long ul_LO_QUICK_local_Counter;
00051 unsigned long ulMaxLogs;
00052 unsigned long ulMaxZips;
00053 unsigned long ulTimeOut;
00054 SCURRENTDATETIME *scdt;
00055 char *chLogFileName;
00056 char *chMaskLogFile;
00057 char *chExteLogFile;
00058 char *chMaskZipFile;
00059 char *chExteZipFile;
00060 char *chExteBakFile;
00061 char *chConfigFile;
00062 char *chExtExecutionString;
00063 char *chExtParameterString;
00064 DWORD dwExtCreationFlags;
00065
00066
00067 DWORD dwLogBufferLength;
00068 DWORD dwLogWidth;
00069 size_t stSLOGTEXTINILength;
00070 } SLOGTEXTINI;
00071
00072
00073 typedef struct sIni
00074 {
00075 struct sIni *_nextEntry;
00076 char *chSection;
00077 SLOGTEXTINI *slogtextini;
00078 unsigned long ulLines;
00079 } SINISECTION;
00080
00081
00082 typedef struct sLogTextExQ
00083 {
00084 struct sLogTextExQ *_nextEntry;
00085 char *chApplication;
00086 char *chLogText;
00087 SLOGTEXTINI *slogtextini;
00088 unsigned long ulLostMessages;
00089 } SLOGTEXTINIQ;
00090
00091
00092 #define LO_ECHO 0x00000001
00093 #define LO_ECHO_ONLY 0x00000002
00094 #define LO_QUICK 0x00000004
00095 #define LO_LOGNAME_ONLY 0x00000008
00096 #define LO_INCLUDE_APP 0x00000010
00097 #define LO_NO_DATE 0x00000020
00098 #define LO_DAILY 0x00000040
00099 #define LO_WEEKLY 0x00000080
00100 #define LO_MONTHLY 0x00000100
00101 #define LO_YEARLY 0x00000200
00102 #define LO_LINES 0x00000400
00103 #define LO_SIZE 0x00000800
00104 #define LO_DELETE_ZIPS 0x00001000
00105 #define LO_DELETE_LOGS 0x00002000
00106 #define LO_LOG_DELETION 0
00107 #define LO_DONT_LOG_DELETION 0x00004000
00108 #define LO_DONT_ZIP 0x00008000
00109 #define LO_LOG_ZIPPING 0
00110 #define LO_DONT_LOG_ZIPPING 0x00010000
00111
00112 #define LO_NO_BANNER 0x00020000
00113 #define LO_TIME_T 0x00040000
00114 #define LO_STDERR 0x00080000
00115 #define LO_USER_ISO_DATE 0x00100000
00116 #define LO_REG_ISO_DATE 0x00200000
00117 #define LO_KEEP_CRLF 0x00400000
00118 #define LO_LOG_REGISTRY 0
00119 #define LO_DONT_LOG_REGISTRY 0x00800000
00120 #define LO_LOGNAME 0x01000000
00121 #define LO_LOG_ALL 0
00122 #define LO_DONT_LOG_ACTIONS (LO_DONT_LOG_DELETION | LO_DONT_LOG_ZIPPING | LO_DONT_LOG_REGISTRY)
00123
00124
00125 #define LE_NO_CONFIG 0x00000001
00126 #define LE_LOG_CONFIG 0
00127 #define LE_DONT_LOG_CONFIG 0x00000002
00128 #define LE_DONT_LOG 0x00000004
00129 #define LE_SET_DATE_TIME 0x00000008
00130
00131
00132
00133
00134
00135 #define LE_FORCE_BINARY 0x00000020
00136 #define LE_LOG_BINARY LE_FORCE_BINARY
00137
00138
00139 #define LE_SORT_DIR 0x00000040
00140
00141
00142
00143
00144 #define LE_PAUSE_BEFORE_LOG 0x00000080
00145
00146
00147 #define LE_DONT_LOG_MS 0x00000100
00148 #define LE_NO_MS LE_DONT_LOG_MS
00149 #define LE_LOGTEXTEXQ 0x00000200
00150 #define LE_PAUSE_AFTER_LOG 0x00000400
00151
00152
00153 #define LE_SUSPEND_LOG 0x00001000
00154 #define LE_RESUME_LOG 0x00002000
00155 #define LE_IGNORE_EVENT 0x00004000
00156
00157 #define LE_THREE_BLANKS 0x00008000
00158
00159
00160
00161
00162
00163
00164 #define LE_DONT_LOG_SEC 0x00010000
00165
00166
00167
00168 #define LE_DONT_LOG_SECS LE_DONT_LOG_SEC
00169 #define LE_NO_SEC LE_DONT_LOG_SEC
00170 #define LE_NO_SECS LE_DONT_LOG_SEC
00171 #define LE_DONT_LOG_SECMS LE_DONT_LOG_SEC
00172 #define LE_NO_BANNER 0x00020000
00173 #define LE_ADD_DOT 0x00040000
00174
00175
00176 #define LE_ADD_FULL_STOP LE_ADD_DOT
00177
00178
00179 #define _MASK_LOGFILE "*.log"
00180 #define _EXTE_LOGFILE ".log"
00181 #define _MASK_ZIPFILE "*.gz"
00182 #define _EXTE_ZIPFILE ".gz"
00183 #define _EXTE_BAKFILE ".~tmp.bak"
00184
00185 #ifdef __cplusplus
00186 extern "C" {
00187 #endif
00188
00189 #define CALLCONV __cdecl
00190 #define STDCCONV __stdcall
00191
00192
00193 extern DllExport int CALLCONV LogText (const char *chApplication, const char *chLogText, DWORD dwOptions,
00194 unsigned long ulMaxLogs, unsigned long ulMaxZips);
00195
00196 extern DllExport int CALLCONV LogTextEx (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00197
00198
00199 extern DllExport int CALLCONV LogTextExQ (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00200
00201
00202 extern DllExport int STDCCONV sLogText (const char *chApplication, const char *chLogText, DWORD dwOptions,
00203 unsigned long ulMaxLogs, unsigned long ulMaxZips);
00204 extern DllExport int STDCCONV sLogTextEx (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00205 extern DllExport int STDCCONV sLogTextExQ (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00206
00207
00208 extern DllExport BOOL bDequeueOnExit;
00209 extern DllExport BOOL bAboutToExit;
00210
00211 typedef int (CALLCONV *LPLOGTEXT) (const char *chApplication, const char *chLogText, DWORD dwOptions,
00212 unsigned long ulMaxLogs, unsigned long ulMaxZips);
00213 typedef int (CALLCONV *LPLOGTEXTEX) (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00214 typedef int (CALLCONV *LPLOGTEXTEXQ) (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00215
00216 typedef int (STDCCONV *LPSLOGTEXT) (const char *chApplication, const char *chLogText, DWORD dwOptions,
00217 unsigned long ulMaxLogs, unsigned long ulMaxZips);
00218 typedef int (STDCCONV *LPSLOGTEXTEX) (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00219 typedef int (STDCCONV *LPSLOGTEXTEXQ) (const char *chApplication, const char *chLogText, SLOGTEXTINI *sltIni);
00220
00221 extern LPLOGTEXT lpLogText;
00222 extern LPLOGTEXTEX lpLogTextEx;
00223 extern LPLOGTEXTEXQ lpLogTextExQ;
00224 extern LPSLOGTEXT lpsLogText;
00225 extern LPSLOGTEXTEX lpsLogTextEx;
00226 extern LPSLOGTEXTEXQ lpsLogTextExQ;
00227 extern HMODULE hLogTextDLL;
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240 int LoadAndInitializeLogText (char *chLogTextPath);
00241
00242 #ifdef __cplusplus
00243 }
00244 #endif
00245
00246 #endif
|