So I have an old ActiveX object that I want to create a testing harness around. I use C# with .Net primarily so I figured that would be the best language to use. The ActiveX object is used to perform various functions and return values; it's not something I would use as a form control.
I've made some attempts, all which have ended horribly. I tried creating a C# console app and getting the .ocx as a reference (it's registered with the system so I just used the list of com objects under references). I then created a class for the object. This class has a variable to hold the object (the variable is an interface and then initialized as an object) and one function which calls on a function inside the object. This returns "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))" The control is not imbeded, nor can it be according to error messages, if that makes a difference.
My next attempt was to add the control as a form object, even though it really isn't (function wise at least; there is not graphical output). To do this I simply imported the .ocx as a control (right click on a control, select "choose items") and put it in the form. I then called the control in the constructor after InitializeComponent(). This ends up in "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))". As I said earlier I have registered the class. I ran regsvr32 and it said everything was fine.
Any ideas? Am I going about this the wrong way or am I missing something stupid simple (or really complex)?