Problem Using an Old 3rd Party ActiveX in VB.NET

Posted on 2011-05-09
Last Modified: 2012-06-27
We have an existing application written in ASP.NET.  It calls a ActiveX control that is written in VB6.  The VB6 ActiveX has a Window Form that has an old third party ActiveX control on it.  I have a problem stepping through the source code of the VB6 ActiveX control from the .NET program.  I believe one of the solution is to convert it from VB6 to VB.NET.  I have used the Upgrade Wizard in Visual Studio 2003 to convert the VB6 ActiveX to VB.NET.  But it cannot convert the event handlers that are supposed to handle the events coming from the third party ActiveX control.  I need help to get around with this problem.

The old third party AciveX control is called "Formula One 6.0" that provides a spreadsheet on a Window Form.  It used to be from  But that company seems to be gone, and its web site no longer exists.  I need to find a way to work with it as best as I can.

Example 1, the event handler of the original VB6 ActiveX is this:

Private Sub F1Grid_StartEdit(EditString As String, Cancel As Integer)
End Sub

The VS 2003 Upgrade Wizard converts it into this:

Private Sub objF1Grid_StartEditEvent( _
   ByVal eventSender As System.Object, _
   ByVal eventArgs As AxTTF160.DF1Events_StartEditEvent) _
   Handles objF1Grid.StartEditEvent
End Sub

But it shows the following two errors:
1.  Type 'AxTTF160.DF1Events_StartEditEvent' is not defined.
2.  Event 'StartEditEvent' cannot be found.

Example 2, the event handler of the original VB6 ActiveX is this:

Private Sub objF1Grid_KeyDown(KeyCode As Integer, Shift As Integer)
End Sub

The VS 2003 Upgrade Wizard converts it into this:

Private Sub objF1Grid_KeyDown( _
   ByVal eventSender As System.Object, _
   ByVal eventArgs As System.Windows.Forms.KeyEventArgs) _
   Handles objF1Grid.KeyDown
End Sub

But it shows the following error:
-   Method 'objF1Grid_KeyDown' cannot handle Event 'KeyDown' because they do not have the same signature.

How can I fix these?  Please help.  Thanks.

Jay Chan
Question by:homerslmpson
    LVL 1

    Accepted Solution

    Turns out this problem is caused by simple things:

    1.  I didn't know enough to "Add Reference" to the third party ActiveX (as a COM).

    2.  I didn't pay attention to the fact that the third party ActiveX control didn't show up in the Windows Form after the ActiveX form has been upgraded from VB6 to VB.NET.  This should be a dead giveaway that the Upgrade Wizard could not add the third party ActiveX control onto the Windows Form.  I manually added it to the Windows Form, and all the error messages are gone now.

    Sorry for asking too soon.
    LVL 1

    Author Closing Comment

    I found where the problem was.

    No one told me anything anyway.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    maxBlock challenge 30 90
    sumNumber challenge 16 80
    lucky13 challenge 11 96
    factory design pattern vs abstract factoy design pattern 2 64
    There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now