声明如下:
Declare Function ReadEventLog Lib "advapi32.dll" Alias "ReadEventLogA" (ByVal hEventLog As Long, ByVal dwReadFlags As Long, ByVal dwRecordOffset As Long, lpBuffer As EVENTLOGRECORD, ByVal nNumberOfBytesToRead As Long, pnBytesRead As Long, pnMinNumberOfBytesNeeded As Long) As Long 
出现用户定义类型未定义的错误!有大虾在vb中用过这个函数吗!给个列子!谢谢

解决方案 »

  1.   

    Public 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