Tim Net Posted May 6, 2008 Posted May 6, 2008 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: 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: So, how does one get a slim description using _EventLog__Report? TIA.
PsaltyDS Posted May 6, 2008 Posted May 6, 2008 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: 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: 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
ChrisL Posted May 6, 2008 Posted May 6, 2008 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 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
PsaltyDS Posted May 6, 2008 Posted May 6, 2008 Just out of interest how do you pass the data %2 thru %5 PsaltyDS, I've always used the WSH method but this looks interestingI 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
ChrisL Posted June 12, 2008 Posted June 12, 2008 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: 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: 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 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now