[ACXFAQ024]
How do I generate a list of an ActiveX object's events in Visual Basic 6?


By using the TLBINF32.DLL (the one used by Visual Basic's Object Browser), you can obtain a list of the interfaces of our ActiveX objects.

The following example will populate a list box component with the events of our iAngularGaugeX component...

Example Setup

TLI Event List Example

Private Sub Command1_Click()
  Dim TLIApp As New tli.TLIApplication
  Dim CoClassInfo As tli.CoClassInfo
  Dim MemberInfo As tli.MemberInfo
  Dim InterfaceInfo As tli.InterfaceInfo

  List1.Clear

  'Get Class Info from component named "iAngularGaugeX1"
  Set CoClassInfo = TLIApp.ClassInfoFromObject(iAngularGaugeX1)

  'Get Event Interface
  Set InterfaceInfo = CoClassInfo.DefaultEventInterface

  'Loop through all members of the Event Interface
  For Each MemberInfo In InterfaceInfo.Members
    'Add Name of Event Member to ListBox
    List1.AddItem MemberInfo.Name
  Next MemberInfo
End Sub


Copyright ©1998-2007 Iocomp Software Incorporated. Iocomp and the Iocomp Logo are registered trademarks of Iocomp Software Inc. All other trademarks are registered by their respective owners.