"Binding" an interface to an object definition in vb.net??

B

barcrofter

Im still confused with interfaces for COM objects. I have a Lotus
word processor that I'm trying to automate via vb.net. The exe comes
with an interface that I can add as a reference .. but.. I cannot
seem to generate an instance of it because (error message) the .tlb
file only provides the interface. Thus I use CreateObject("etc") to
define an object that picks up the exe.

Question: is there any way or trick for binding the object to the
interface so that I can debug the program more speedily and access its
methods more easily??
 
M

Mattias Sjögren

Question: is there any way or trick for binding the object to the
interface so that I can debug the program more speedily and access its
methods more easily??

Not sure what you mean by binding exactly, but it sounds like a
regular cast should do it.

Dim x As IFoo = CType(CreateObject(...), IFoo)


Mattias
 
B

barcrofter

Not sure what you mean by binding exactly, but it sounds like a
regular cast should do it.

Dim x As IFoo = CType(CreateObject(...), IFoo)

Mattias

That did it -- thanx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top