Using legacy ActiveX controls in Vs2005--Problems

G

Guest

We are trying to use legacy Visual Basic 6 ActiveX controls in C# projects
under Vs2005. The importing into Vs2005 Tools of the registered Ocx works
fine. We can place an instance of the control on a Form and the field
representing the control shows many methods and properties of the control.
The control is visible if the App is run. The problem is that many of the
methods are of the form "axSpinnerObj1.set_Min(ref object param0)". This is a
spinner control and one would expect this method to take a numeric value such
as an interger but the method takes an "object" which could be anything. The
control is a Third Party control and there is no indication of what the
"object" is. Examination of the Ax...dll and Interop...dll with Reflector
does not indicate what the object is. One would think that it is an integer
but attempting to pass an integer to the function causes it to fail since it
is expecting a type "object".

Can you suggest a solution to this?

Also are there any good books on ActiveX (created by Visual Basic 6 and
Visual C++ 6) controls as to using them in Vs2005 C# Form based projects
(i.e., Interop)?

Thanks.


int min=190;
object ob=null;
double vd=190.0;
string ca="Hello from axSpinnerObj1";
axSpinnerObj1.TipText="Tip text for spinner object";
axSpinnerObj1.set_ValueAsDouble(ref vd);
axSpinnerObj1.set_Caption(ref ca);
//axSpinnerObj1.set_Min(ref object param0)
axSpinnerObj1.set_Min(ref ob);
 

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