Click to See Complete Forum and Search --> : How to implenment QueryInterface method in vb just like in VC++
Tsinghua
August 27th, 2001, 10:30 PM
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!
berta
August 28th, 2001, 02:02 AM
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/images/bertaplanet.gif'>
</center>
Tsinghua
August 28th, 2001, 02:31 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.