Write an Event to the Event viewer

前端 未结 2 669
醉梦人生
醉梦人生 2021-01-31 21:04

I found an example in C# how to add new Event to the Event Viewer. But, I need an example written in C++ (not .NET) that create new Event to the Event Viewer under the \"Applica

2条回答
  •  有刺的猬
    2021-01-31 21:07

    You're looking for the documentation on the Windows Event Log API. You'll need to call the native Win32 API functions, rather than use the .NET Framework's wrappers, since you're writing in unmanaged C++.

    If you're targeting operating systems prior to Windows Vista (XP, Server 2003, etc.), you'll need to use the older Event Logging API instead.

提交回复
热议问题