Reference an interface in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form in a dll which in addition to the normal window stuff
implements an interface, interfA. I want to reference the properties and
methods of interfA as implemented in that form. I know I've seen the
documentation for this somewhere but I can't find it any more. The code goes
something like
'
'get the form (this part is ok)
'
dim asm as reflection.assembly
asm.loadfrom("MyDLL")
dim f as form
f =ctype(asm.createinstance("MyDLL.Form1"),Form)
'
' set up the interface (???)
'
dim i as interfA
i=f
'
' reference the interface (???)
'
dim intA as integer = i.a ' a = method of interfA
'

Can someone please help?
 
You will probably need to cast your form variable to the interface
variable. Something like this:

Dim i As interfA = DirectCast(f,interfA)

'Call methods on i here...
 
Back
Top