CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    9

    How to implenment QueryInterface method in vb just like in VC++

    Hi
    who can tell me how can i implenment QueryInterface method in vb just like in VC++ and how to use ATLInternalQueryInterface API in ATL.DLL ?
    Thanks!


  2. #2

    Re: How to implenment QueryInterface method in vb just like in VC++

    U can't implementing a QueryInterface in vb.
    when U develops a ATL component in VB many declaretions and implemnetations are implicit unlike VC++ where U must declare everything.

    so add a Class in ActiveX DLL VB project (myClass) and put the following code:

    public sub sayHello
    msgbox "say hello"
    end sub

    set property Instansing = Multiuse.

    now U have create a Interface named myClass and a coClass nemed myClass.

    if U want to call this class and its methods:

    dim obj as myDLLProject.myClass 'early binding
    ' dim obj 'late binding

    set obj = createobject("myDLLProject.myClass")

    obj.sayHello

    hi,brt


    <center>
    <HR width=80%>
    <img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
    </center>

  3. #3
    Join Date
    Aug 2001
    Posts
    9

    Re: How to implenment QueryInterface method in vb just like in VC++

    Thanks berta!

    I have written my words to create ATL Control,which use ATL API,also i can get the IUnkown pointer in vb using AtlAxGetControl API, then i want to get pObject by using ATLInternalQueryInterface API ,but i don't know how to use it.
    thanks anyway!
    Tsinghua


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured