Dim a As New TypeLibInfo
    a.ContainingFile = "D:\MyClass.ocx"
    Dim i As Integer
    Dim objclass As CoClassInfo
    Set objclass = a.CoClasses(1)
    
    Dim interface As InterfaceInfo
    Set interface = objclass.Interfaces(1)
   
    For i = 1 To interface.Members.Count
        Debug.Print interface.Members.Item(i)
    Next i'从以上信息我得到了类名,也能得到类所对应的接口,接下来我该如何调用这个接口呢??
请各位大虾帮帮忙!!

解决方案 »

  1.   

    用TypeLib Information干什么,直接引用类,再调用不就行了试试:
    dim a 
    set a=CreateObject(得到的类名)
      

  2.   

    不行呢,本人比较菜,用了上面的语句后,VB会报错!
    代码:
       dim a
       set a = CreateObject("Buffer")出错提示:
    Run-time error '429':
    ActiveX component can't create object我该怎么办?
      

  3.   

    //set a = CreateObject("Buffer")
    Buffer是什么?
    把程序完整贴上来
      

  4.   

    buffer是我在本工程里建立的类模板中的一个类--buffer.cls。