|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The KillerVB EventLogLib can be used to read from the Event Log. Sure,
writing to the event log is a snap, but have you ever tried to read from it,
@#%!*^@ !? If it weren't for a couple of C++ MSDN articles even VC
developers would struggle with reading the EventLog. It's even more difficult
for the advanced VB developer because not all C++ examples port well to VB.
Fortunately, I've already done the hard work for you.
If you can scroll a Recordset object, then you already know how to use this
library. That's because the EventLogReader object was modeled after the
Recordset. All resource strings are completely dereferenced and expanded, and
SID's are converted to UserID's.
Remote Event Logs
I hate it when I open a remote event log from NT and see a message that the
resource cannot be found. That won't be a problem with this library, however.
The EventLog reader opens the remote registry to locate the resource strings,
and automatically maps logical drive specs to remote network resources. If the
EventLogReader cannot open the remote resource, it attempts to find it on the
local computer. This is typical in that one might have access to read the
EventLog, but not have access to the DLL (or system folder) that holds the
resource strings. Chances are, some of those resources can be found on the
local machine.
This release supports reading the EventLog. I haven't quite finished cleaning
up the EventLogWriter, and related classes. Be sure to check back from time to
time.
|
|
|
|
|
|
|
P EventLogLib.Vbp
|
|
|
Modules
|
|
|
|
Classes
|
|
|
|
|
P EventLogReader Sample.Vbp
|
|
|
Forms
|
|
|
|
Modules
|
|
|
|
|
| |
|
|
| |
| |
|
| Carl - Never you mind! |
| Hi,
I keep getting an error when trying to run this in VB6 with:-
User-defined type not defined
This is on the following:-
Private m_EventLog As EventLogLib.EventLogReader
I think I'm missing a COM Object but which?????
Cheers,
Carl. |
 |
| Alex |
| Solution for error when number of insertion strings is over 10:
In function CharArrayToPointers add If iElement > UBound(ArgArray) Then
ReDim Preserve ArgArray(LBound(ArgArray) To UBound(ArgArray) + 10)
End If
after iElement = iElement + 1
Otherwise, this library throws an error when more then 10 insertion points are found. |
 |
| Thomas |
| Thank you ! I find a long time for this.But I want get the code of kvbEventLogLib.dll .Could you give me ? |
 |
| Adrian |
| This code rocks. Thanks! You are right. You have to be a rocket scientist to read the EventLog. One wonders why it had to be so complex. |
 |
| Carl - Glad I never told you! |
| Hi,
When all else fails....download "The Code" and save yourself hours of being "a dick"......I will in future :-)
Cheers,
Carl. |
 |
| gerd |
| ther is a problem, wenn you want to see the details of an entry, where the username is "ANONYMOUS-Anmeldung".
can u fix it? |
 |
| Alex |
| Hi, VB6 trows exception and closes when this event gets read:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 19/07/2007 6:36:27 p.m.
Event time (UTC): 19/07/2007 6:36:27 a.m.
Event ID: c341a123ea9f4ca4b65d956d1d739b06
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-1-128293005874857264
Trust level: Full
Application Virtual Path: /
Application Path: c:\inetpub\wwwroot\
Machine name: IBMLAPTOP
Process information:
Process ID: 1140
Process name: aspnet_wp.exe
Account name: IBMLAPTOP\ASPNET
Exception information:
Exception type: ConfigurationErrorsException
Exception message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. (c:\inetpub\wwwroot\pukekoheinfo\web.config line 39)
Request information:
Request URL: http://localhost/pukekoheinfo/Default.aspx
Request path: /pukekoheinfo/Default.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: IBMLAPTOP\ASPNET
Thread information:
Thread ID: 1
Thread account name: IBMLAPTOP\ASPNET
Is impersonating: False
Stack trace: at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
at System.Web.Configuration.RuntimeConfig.get_Identity()
at System.Web.ClientImpersonationContext.Start(HttpContext context, Boolean throwOnError)
at System.Web.HttpApplication.OnThreadEnter()
at System.Web.HttpApplication.ResumeSteps(Exception error)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
It looks like the error is too big for some buffer. I am working on resolving this, but if you have code changed for this, please let me know. Thanks for your help.
Alex |
 |
| Joe - (Cant say) |
| I'm using your event log lib tu write a remote event monitoring tool. so far it's working great. After looking at the code, I dontt think I would have ever figured out how to read the event log. Thanks.
plz let me know when you add features. |
 |
|
| |
|
|
|
|
|