我想知道是否有任何 WinAPI 可以替换以下函数EventLog::Exists()
,EventLog::CreateEventSource()
所以我的代码不会依赖.NET Framework
.
如果您能给我一些建议,我将不胜感激!
#define PRINT_SOURCE_NAME "Microsoft-Windows-PrintService"
#define PRINT_LOG_NAME "Microsoft-Windows-PrintService/Operational"
BOOL bRet = EventLog::Exists(PRINT_LOG_NAME );
if (!bRet)
{
EventLog::CreateEventSource(PRINT_SOURCE_NAME , PRINT_LOG_NAME );
}