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

  • Thread starter Thread starter barcrofter
  • Start date Start date
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??
 
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
 
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
 
Back
Top