LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data to Windows event log

Hallo *

does anyone know how to write log messages to winNT event log??

txh
chris
0 Kudos
Message 1 of 3
(3,003 Views)
[posted and mailed]

harboeck@in.tum.de (Christian Harböck) wrote in
<3A104790.1E6321D8@in.tum.de>:

>Hallo *
>
>does anyone know how to write log messages to winNT event log??
>

I don't. But I can suggest that there might be an API call that does this.
Perhaps check out the MSDN CD's for this information.

cheers, Alex.

--

Alexander C. Le Dain, PhD
ICON Technologies Pty Ltd
http://www.icon-tech.com.au

******************************************************************
* The LabVIEW FAQ http://www.icon-tech.com.au/thelabviewfaq.html *
******************************************************************
0 Kudos
Message 2 of 3
(3,003 Views)
There are API's to do this:

BackupEventLog
ClearEventLog
CloseEventLog
DeregisterEventSource
GetNumberOfEventLogRecords
GetOldestEventLogRecord
NotifyChangeEventLog
OpenBackupEventLog
OpenEventLog
ReadEventLog
RegisterEventSource
ReportEvent

From advapi32.dll.

For your application (just reporting) you'll need:

BOOL ReportEvent(
HANDLE hEventSource, // handle returned by RegisterEventSource
WORD fwEventType, // event type to log
WORD fwCategory, // event category
DWORD IDEvent, // event identifier
PSID pUserSid, // user security identifier (optional)
WORD cStrings, // number of strings to merge with message
DWORD cbData, // size of binary data, in bytes
LPCTSTR *plpszStrings, // array of strings to merge with me
ssage
LPVOID lpvData // address of binary data
);

I've done this once, I'll have to dig it up. It might take a while...

Regards,

Wiebe Walstra.

--
AIR technical Automation
www.air.nl
"Alex" wrote in message
news:8FED8149Faledainupnawaycom@203.59.24.168...
[posted and mailed]

harboeck@in.tum.de (Christian Harböck) wrote in
<3A104790.1E6321D8@in.tum.de>:

>Hallo *
>
>does anyone know how to write log messages to winNT event log??
>

I don't. But I can suggest that there might be an API call that does this.
Perhaps check out the MSDN CD's for this information.

cheers, Alex.

--

Alexander C. Le Dain, PhD
ICON Technologies Pty Ltd
http://www.icon-tech.com.au

******************************************************************
* The LabVIEW FAQ http://www.icon-tech.com.au/thelabviewfaq.html *
******************************************************************
0 Kudos
Message 3 of 3
(3,003 Views)