Jump to content

_EventLog__Report obtuse Description.


Recommended Posts

If I use the helpfile's example, I get an obtuse event log with much fluff and little 'data'. If I use EVENTCREATE.EXE, a much more compact and clean Description.

Here's what I see from the example:

post-11167-1210093645_thumb.jpg

Here's the output from Eventcreate:

c:\>EVENTCREATE /T ERROR /ID 999 /L APPLICATION  /SO WinWord /D "new source Winword in application log"

Here's the good eventlog entry that I'd like AutoIt to be able to recreate:

post-11167-1210093800_thumb.jpg

So, how does one get a slim description using _EventLog__Report?

TIA.

Link to comment
Share on other sites

If I use the helpfile's example, I get an obtuse event log with much fluff and little 'data'. If I use EVENTCREATE.EXE, a much more compact and clean Description.

Here's what I see from the example:

post-11167-1210093645_thumb.jpg

Here's the output from Eventcreate:

c:\>EVENTCREATE /T ERROR /ID 999 /L APPLICATION  /SO WinWord /D "new source Winword in application log"

Here's the good eventlog entry that I'd like AutoIt to be able to recreate:

post-11167-1210093800_thumb.jpg

So, how does one get a slim description using _EventLog__Report?

TIA.

You only get that result because you passed an invalid EVENTID for the "Application" source. Try this code:

#include <EventLog.au3>

Global $hEventLog, $aData[1]=[0]
Global $hEventLog = _EventLog__RegisterSource("", "Application Error")
_EventLog__Report($hEventLog, 1, "None", 1000, "", "AutoIt3 generated event", $aData)
_EventLog__Close ($hEventLog)

...and you get:

Faulting application AutoIt3 generated event, version %2, faulting module %3, version %4, fault address 0x%5.

EVENTID = 1000 is valid for "Application Error" source, and the %2 thru %5 are where relevant information to that EVENTID would normally be passed.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You only get that result because you passed an invalid EVENTID for the "Application" source. Try this code:

#include <EventLog.au3>

Global $hEventLog, $aData[1]=[0]
Global $hEventLog = _EventLog__RegisterSource("", "Application Error")
_EventLog__Report($hEventLog, 1, "None", 1000, "", "AutoIt3 generated event", $aData)
_EventLog__Close ($hEventLog)

...and you get:

Faulting application AutoIt3 generated event, version %2, faulting module %3, version %4, fault address 0x%5.

EVENTID = 1000 is valid for "Application Error" source, and the %2 thru %5 are where relevant information to that EVENTID would normally be passed.

:)

Just out of interest how do you pass the data %2 thru %5 PsaltyDS, I've always used the WSH method but this looks interesting
Link to comment
Share on other sites

Just out of interest how do you pass the data %2 thru %5 PsaltyDS, I've always used the WSH method but this looks interesting

I just opened up Eventlog.au3 and looked at the DLL call inside the _EventLog__Report() function. Google it in MSDN and you get all the gory details.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 1 month later...

If I use the helpfile's example, I get an obtuse event log with much fluff and little 'data'. If I use EVENTCREATE.EXE, a much more compact and clean Description.

Here's what I see from the example:

post-11167-1210093645_thumb.jpg

Here's the output from Eventcreate:

c:\>EVENTCREATE /T ERROR /ID 999 /L APPLICATION  /SO WinWord /D "new source Winword in application log"

Here's the good eventlog entry that I'd like AutoIt to be able to recreate:

post-11167-1210093800_thumb.jpg

So, how does one get a slim description using _EventLog__Report?

TIA.

I think I have created the answer to your problem http://www.autoitscript.com/forum/index.php?showtopic=73440

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...