Using ActiveX Controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

    #1

    Using ActiveX Controls

    hI have a series of ActiveX controls written in VB6 that I want to now use in
    VB.NET. In the VB6 world I loaded these controls at runtime as needed. This
    worked great as they all implemented a common interface.

    I am having some issues now when I try to do the same things in VB.NET. The
    controls will load, however, they fail on the following line of code

    If TypeOf UserControl.Ext ender.Parent Is IControlInterfa ce Then


    In VB6, the controls were hosted on a Form that implemented the
    IControlInterfa ce. When they loaded they check to make sure that the control
    hosting them implements that interface. I imported the library containing
    that interface definition into VB.NET. I then created a class that inherited
    from AxHost and it implements that interface. However, it seems that when the
    CLR and the RCW do their thing, the fact that the control hosting the ActiveX
    control implements this interface is lost.

    Is there anyway that I can get the ActiveX control to realize that the .NET
    control hosting it does implement the interface? Is there an attribute that I
    should be using?

    Thanks for the help!

    Dan
Working...