Writing to Windows Application Event log - how?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Writing to Windows Application Event log - how?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by Anonymous >> Sun, 23 Nov 2003 20:24:58 GMT

I wish to create Application Event entries from JADE. I thought I may have been able to do so via an user32 external function: I searched the MSDN Library site for "application event log", which only returned "how to's" for non-JADE languages.

If it is possible, would you please advise how I can create log entries via JADE or the function name/dll that I should use?

Thanks in advance.
Michael

--------------------------
Michael Ross
Analyst Programmer
Southland Building Society
DDI: +64 3 211 0765
Fax: +64 3 211 0754
--------------------------

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Writing to Windows Application Event log - how?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by Patwos >> Tue, 25 Nov 2003 3:22:21 GMT

It looks like the APIs you want to use are in the advapi32.dll:

RegisterEventSource - open a new event log entry
ReportEvent - write the details
DeregisterEventSource - close the event log entry

The following URL at the Microsoft site should get you started on implementing these APIs from JADE:
http://msdn.microsoft.com/library/defau ... debug/base /registereventsource.asp

Hope that helps,
Pat.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Writing to Windows Application Event log - how?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by Anonymous >> Tue, 25 Nov 2003 22:56:29 GMT

Thanks very much Pat. This is a big help.

I did search MSDN - obviously not hard enough though.

Cheers
Michael

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Writing to Windows Application Event log - how?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:28 pm

by ConcordDev >> Fri, 28 Nov 2003 3:07:56 GMT

Michael,

You might want to try the Windows Scripting Host. You'll find the Library already in your ActiveX Import Wizard.
It has many useful features that are so simple to use.

Here's an example:

vars
wsh : IWshShell_Class;begin

create wsh transient;
wsh.logEvent (0, //--- Event Type (Success)
"Event text here", //---
null //--- Event log computer (optional)
);
epilog
delete wsh;

I also use it for creating shortcuts, obtaining Windows folders (My Documents...), direct printing...

Yours,
Andrew

http://msdn.microsoft.com/library/defau ... cript56/ht ml/wsconwindowsscripthostobjectmodel.asp


Return to “General Discussion”

Who is online

Users browsing this forum: Bing [Bot] and 30 guests