H
hufaunder
I have an ActiveX component that I want to use in a library that I am
writing. As a first test I used the ActiveX component in a windows
form application. Adding the component created:
Ax[ActiveXName].dll
[ActiveXName].dll
I can not call the functions in the ActiveX component. In the next
step I tried to use the ActiveX component in a class library. I simply
added a reference to the corresponding COM component. This this only
[ActiveXName].dll was created. I assume this is ok because the
Ax...dll is just wrapping the component in a control (which I don't
need).
Now I have the following code:
ActiveXClassName class = new ActiveXClassName; //Note there is no Ax
in front of the class
class.DoSomething();
The second command produces and error: "COMException was unhandled.
Catastrphic failure (Exception from HRESULT:
0x8000FFFF(E_UNEXPECTED))"
I then added the following after instantiating the class:
((System.ComponentModel.ISupportInitialize)(class)).BeginInit();
This produces the error: "Unable to cast COM object of type 'xxx' to
interface type 'System.ComponentModel.ISupportInitialize'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{CF793A55-B9DD-30C2-A484-360AF143C228}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
So what do I need to do to use this ActiveX component in my class
library?
Thanks
writing. As a first test I used the ActiveX component in a windows
form application. Adding the component created:
Ax[ActiveXName].dll
[ActiveXName].dll
I can not call the functions in the ActiveX component. In the next
step I tried to use the ActiveX component in a class library. I simply
added a reference to the corresponding COM component. This this only
[ActiveXName].dll was created. I assume this is ok because the
Ax...dll is just wrapping the component in a control (which I don't
need).
Now I have the following code:
ActiveXClassName class = new ActiveXClassName; //Note there is no Ax
in front of the class
class.DoSomething();
The second command produces and error: "COMException was unhandled.
Catastrphic failure (Exception from HRESULT:
0x8000FFFF(E_UNEXPECTED))"
I then added the following after instantiating the class:
((System.ComponentModel.ISupportInitialize)(class)).BeginInit();
This produces the error: "Unable to cast COM object of type 'xxx' to
interface type 'System.ComponentModel.ISupportInitialize'. This
operation failed because the QueryInterface call on the COM component
for the interface with IID '{CF793A55-B9DD-30C2-A484-360AF143C228}'
failed due to the following error: No such interface supported
(Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."
So what do I need to do to use this ActiveX component in my class
library?
Thanks