Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

ActiveX in DLL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hufaunder@yahoo.com - 02 Feb 2007 07:51 GMT
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
Patrick Steele - 02 Feb 2007 14:15 GMT
> 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

This looks like an ActiveX control.  Is that what it is -- or is it an
ActiveX DLL?  Two different things.

> I can not call the functions in the ActiveX component.

Can you clarify that some more?  

> 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).

If I recall, you're going to have a difficult time using a wrapped
ActiveX control in a class library since an ActiveX control is usually
designed to be hosted on a windows form that has a standard windows
message pump running.  Without that message pump, the ActiveX control
will not work properly inside a class library.

Signature

Patrick Steele
http://weblogs.asp.net/psteele

Alvin Bruney [MVP] - 04 Feb 2007 15:20 GMT
Have you registered the ActiveX object? You'll need to do so before it will
allow instantiation.

Signature

Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc

>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
[quoted text clipped - 35 lines]
>
> Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.