Visual Basic Classic
--
Questions
--
Followers
Top Experts
I am specifically in need of a mechanism to be able to determine if a SPECIFIC EventID was added to the Event Log.
Arthur Wood
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Have a look at the NT Event log examples here:
http://www.netfokus.dk/vbadmincode/winnt.htm
Lots of good examples there.
the netfokis.dk link comes back as Page Not Found, and the btinternet.com link takes me to
http://www.btopenworld.com/default
???
- BackupEventLog: Saves the specified event log to a backup file.
- ClearEventLog: Clears the specified event log, and optionally saves the current copy of the logfile to a backup file.
- CloseEventLog: Closes a read handle to the specified event log.
- DeregisterEventSource: Closes a write handle to the specified event log.
- GetEventLogInformation: Retrieves information about the specified event log.
- GetNumberOfEventLogRecords
- GetOldestEventLogRecord: Retrieves the absolute record number of the oldest record in the specified event log.
- NotifyChangeEventLog: Enables an application to receive notification when an event is written to the specified event logfile.
- OpenBackupEventLog: Opens a handle to a backup event log.
- OpenEventLog: Opens a handle to an event log.
- ReadEventLog: Reads a whole number of entries from the specified event log.
- RegisterEventSource: Retrieves a registered handle to an event log.
- ReportEvent: Writes an entry at the end of the specified event log.
They are documented in: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/event_logging_functions.asp
There are some examples on how to use these API calls in VB, and here are the links:
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=2829&pg=3
http://archive.devx.com/premier/mgznarch/vbpj/1996/03mar96/wprogcol.pdf






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
They are identified in MSDN, but the VALUES are not specified, anywhere.
and in fact, both of the last two links, while helpful, make reference to these CONSTANTS without supplying the VALUES. and without those constants, the code will NEVER compile.
AW
I have NO CONTROL over how the events are being wriiten to the Event log, I simply need a way to be able to READ the events that were written.
I have discovered the with .NET, reading from the Event Log is ALMOST trivial, but at this point, becuase of other system constraints that are also out of my control, I doubt the a .NET solution is acceptable at the moment. I really need a VB ^ solution, and preferably one that does not involve $$$ (there is a Toolkit from Desaware, for working with the NT Event Log, but I am not is a position to spend $$ - customer contraints in a government contract situation precludes that possibility, as well as sever time constraints).
AW
Private Const EVENTLOG_SUCCESS = &H0
Private Const EVENTLOG_ERROR_TYPE = &H1
Private Const EVENTLOG_WARNING_TYPE = &H2
Private Const EVENTLOG_INFORMATION_TYPE = &H4
Private Const EVENTLOG_AUDIT_SUCCESS = &H8
Private Const EVENTLOG_AUDIT_FAILURE = &H10
Private Const EVENTLOG_SEQUENTIAL_READ = &H1
Private Const EVENTLOG_SEEK_READ = &H2
Private Const EVENTLOG_FORWARDS_READ = &H4
Private Const EVENTLOG_BACKWARDS_READ = &H8
Private Type EVENTLOGRECORD
Length As Long ' Length of full record
Reserved As Long ' Used by the service
RecordNumber As Long ' Absolute record number
TimeGenerated As Long ' Seconds since 1-1-1970
TimeWritten As Long 'Seconds since 1-1-1970
EventID As Long
EventType As Integer
NumStrings As Integer
EventCategory As Integer
ReservedFlags As Integer ' For use with paired events (auditing)
ClosingRecordNumber As Long 'For use with paired events (auditing)
StringOffset As Long ' Offset from beginning of record
UserSidLength As Long
UserSidOffset As Long
DataLength As Long
DataOffset As Long ' Offset from beginning of record
End Type

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
but you get the points. and Thank you.
AW






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I believe so but you have to load the .NET framework to system 8-<
Visual Basic Classic
--
Questions
--
Followers
Top Experts
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.