| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #pragma once
- #include "stdafx.h"
- #include "global.h"
- //·þÎñ
- TCHAR g_szServiceName[] = _T("isP-CMS Report Service");
- //*********************************************************
- //Functiopn: LogEvent
- //Description: ¼Ç¼·þÎñʼþ
- //Calls:
- //Called By:
- //Table Accessed:
- //Table Updated:
- //Input:
- //Output:
- //Return:
- //Others:
- //History:
- // <author>niying <time>2006-8-10 <version> <desc>
- //*********************************************************
- void LogEvent(LPCTSTR pFormat, ...)
- {
- TCHAR chMsg[256];
- HANDLE hEventSource;
- LPTSTR lpszStrings[1];
- va_list pArg;
- va_start(pArg, pFormat);
- _vstprintf(chMsg, pFormat, pArg);
- va_end(pArg);
- lpszStrings[0] = chMsg;
-
- hEventSource = RegisterEventSource(NULL, g_szServiceName);
- if (hEventSource != NULL)
- {
- ReportEvent(hEventSource, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (LPCTSTR*) &lpszStrings[0], NULL);
- DeregisterEventSource(hEventSource);
- }
- }
|