Hi,
I have a simple COMcomponent which implements the method Sum(), which is developed in VC++ environment.
I wanted to write a VB client for it. Can any body tell me how to call COM interfaces through VB .
Thanx
kiru
Printable View
Hi,
I have a simple COMcomponent which implements the method Sum(), which is developed in VC++ environment.
I wanted to write a VB client for it. Can any body tell me how to call COM interfaces through VB .
Thanx
kiru
go to Project/References menu in the VB Development Environment and add you COM component's Typelib (probably part of your COM DLL) to the references.
Then hit F2 to start the object browser.
You can see all objects and methods of that component.
Instantiate an object of your component:
dim x as new yourprogid
(or use: set x = createobject("yourprogid"))
call the method
dim lResult as long
lResult = x.Sum
Thanx for replying.
Can U suggest me some books for VB with COM or some sites on net or articles in MSDN.
Once again Thanking U
kiru
the best source that I know of is: MSDN and the online documentation that comes with VB.
You might also want to check out the MSPress site for some VB books.
You don't have to buy any books tho, www.informit.com ...sign up and read almost anybook for FREE, including those on COM components
HI,
I tried creating Com object through the CreateObject() function in VB. But it is givng an error "Activex component can't create object".
I tried same with VB script. It is working fine.
Can U tell me what is the problem in VB.
Thanx
kiran