5.1.6.日誌
1.目的
2.日誌記錄函式庫
#include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { LPTSTR lpszStrings[] = {"Called main() in file", __FILE__}; HANDLE hEventSource = RegisterEventSource(NULL, "myService"); if (hEventSource == NULL){ return 1; } ReportEvent(hEventSource, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 2, 0, (LPCSTR*)lpszStrings, NULL); DeregisterEventSource(hEventSource); return 0; }eventvwr.msc
Last updated


