473,395 Members | 1,595 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Exception .net activex loaded with axhost

I created a activex control in c# (vs 2005)

--------------------------------------------
[Guid("41D7A3C7-B891-4379-BE33-5195A2CFF913"), ComVisible(true)]

public partial class ActiveTest : UserControl

{

public ActiveTest()

{

InitializeComponent();

}

}

--------------------------------------------

I created a axhost derived class to load it:

-----------------------------------------------

public class AxWindows : AxHost

{

public AxWindows()

: base("41D7A3C7-B891-4379-BE33-5195A2CFF913")

{

}

}

------------------------------------------------

When I load it on a form like this:
------------------------------------------------
AxWin.AxWindows ax = new AxWin.AxWindows();

this.Controls.Add(ax);

------------------------------------------------
It works just fine until I close the form. I get the exception:

{"The object's type must be __ComObject or derived from
__ComObject.\r\nParameter name: o"}

Does someone know what the problem is?

Apr 28 '06 #1
8 6781
Hello,

If you create the wrapper class with Aximp.exe, will it also generate the
error?

Windows Forms ActiveX Control Importer-Tool (Aximp.exe):
http://msdn2.microsoft.com/en-us/library/8ccdh774.aspx

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 1 '06 #2
Because it is a .net activex it is impossible to create a wrapper wit
aximp..
(AxImp Error: Error loading type library/DLL. (Exception from HRESULT:
0x80029C4A (TYPE_E_CANTLOADLIBRARY))
"Luke Zhang [MSFT]" <lu******@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGXA01.phx.gbl...
Hello,

If you create the wrapper class with Aximp.exe, will it also generate the
error?

Windows Forms ActiveX Control Importer-Tool (Aximp.exe):
http://msdn2.microsoft.com/en-us/library/8ccdh774.aspx

Regards,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 1 '06 #3
Thank you for the information. I also get same error ("The object's type
must be __ComObject or derived from __ComObject.\r\nParameter name: o")
with a similiar test project. When the form is closing, Axhost will try to
release its loaded ActiveX control (a COM object). However, it is actual a
..NET component. Since you will use a .NET control on a .NET form, why do
you need to add an Axhost "Shell"?
Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 2 '06 #4
I am making an application with driver support. The drivers are created in
com. The com objects can supply a setup display through activex.
I don't use .net components and load them dynamically because I want other
parties to create drivers written in other languages (MFC activex etc).

Is this behavior a bug (You should be able to load activex components in
..net even if they are written themselve in .net) ?

Martijn Boven


"Luke Zhang [MSFT]" <lu******@online.microsoft.com> wrote in message
news:BC**************@TK2MSFTNGXA01.phx.gbl...
Thank you for the information. I also get same error ("The object's type
must be __ComObject or derived from __ComObject.\r\nParameter name: o")
with a similiar test project. When the form is closing, Axhost will try to
release its loaded ActiveX control (a COM object). However, it is actual a
NET component. Since you will use a .NET control on a .NET form, why do
you need to add an Axhost "Shell"?
Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

May 2 '06 #5

"Martijn Boven" <ma*****@daxis.nl> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
|I am making an application with driver support. The drivers are created in
| com. The com objects can supply a setup display through activex.
| I don't use .net components and load them dynamically because I want other
| parties to create drivers written in other languages (MFC activex etc).
|
| Is this behavior a bug (You should be able to load activex components in
| .net even if they are written themselve in .net) ?
|

No, because you can't author ActiveX controls in .NET. ActiveX controls can
only be written using native tools like Delphi, VB and C++. You can't even
write COM components in .NET, you can only 'expose' .NET objects as COM
components to COM clients, but .NET objects aren't exposed as COM objects to
..NET clients.

Willy.

May 2 '06 #6
Ok, didn't know that. I thought they where full active components. Still
rather strange that I only get the error when I close the form.

Thanks for the info..
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:uT**************@TK2MSFTNGP05.phx.gbl...

"Martijn Boven" <ma*****@daxis.nl> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
|I am making an application with driver support. The drivers are created
in
| com. The com objects can supply a setup display through activex.
| I don't use .net components and load them dynamically because I want
other
| parties to create drivers written in other languages (MFC activex etc).
|
| Is this behavior a bug (You should be able to load activex components in
| .net even if they are written themselve in .net) ?
|

No, because you can't author ActiveX controls in .NET. ActiveX controls
can
only be written using native tools like Delphi, VB and C++. You can't even
write COM components in .NET, you can only 'expose' .NET objects as COM
components to COM clients, but .NET objects aren't exposed as COM objects
to
.NET clients.

Willy.


May 2 '06 #7

"Martijn Boven" <ma*****@daxis.nl> wrote in message
news:eG****************@TK2MSFTNGP02.phx.gbl...
| Ok, didn't know that. I thought they where full active components. Still
| rather strange that I only get the error when I close the form.
|

That's because the AxHosts tries to release an 'AxControl' which isn't there
as explained by Luke.

Willy.

| Thanks for the info..
|
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:uT**************@TK2MSFTNGP05.phx.gbl...
| >
| > "Martijn Boven" <ma*****@daxis.nl> wrote in message
| > news:%2****************@TK2MSFTNGP05.phx.gbl...
| > |I am making an application with driver support. The drivers are created
| > in
| > | com. The com objects can supply a setup display through activex.
| > | I don't use .net components and load them dynamically because I want
| > other
| > | parties to create drivers written in other languages (MFC activex
etc).
| > |
| > | Is this behavior a bug (You should be able to load activex components
in
| > | .net even if they are written themselve in .net) ?
| > |
| >
| > No, because you can't author ActiveX controls in .NET. ActiveX controls
| > can
| > only be written using native tools like Delphi, VB and C++. You can't
even
| > write COM components in .NET, you can only 'expose' .NET objects as COM
| > components to COM clients, but .NET objects aren't exposed as COM
objects
| > to
| > .NET clients.
| >
| > Willy.
| >
| >
| >
| >
| >
|
|
May 2 '06 #8
If what you need is a TLB equivalent to use as a CCW (COM Callable
Wrapper) for use in COM UIs such as MFC you can use regasm to generate
one. But as stated before there is no need to make your UserControl COM
interoperable if you are using it in a .NET UI.

*** Sent via Developersdex http://www.developersdex.com ***
May 17 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kuba Florczyk | last post by:
Hi Do anybody know how to show ActiveX whitout AxHost? For example i got wrapper to ActiveX and now i don't know how AxHost shows ActiveX. I must do it, because i think AxHost made it wrong...
0
by: Nathan Baulch | last post by:
I have an XML file that my application reads at runtime: <form> <control clsid="B5ECA9DC-879F-40BC-9298-3E399E099C0B"> <name>btnGO</name> <top>10</top> <left>10</left> <myint>273</myint>...
1
by: derhally | last post by:
I currently have the IE ActiveX object embedded inside an application. I'm running into a problem where when I make the control visible or have it navigate to a different page, the application...
0
by: MikeZ | last post by:
I have a 3rd party ActiveX Control in windows Form. It sometimes generates error which not come from my source code. How can I handle this? Thanks. See the end of this message for details on...
0
by: Dan | last post by:
hI have a series of ActiveX controls written in VB6 that I want to now use in VB.NET. In the VB6 world I loaded these controls at runtime as needed. This worked great as they all implemented a...
0
by: Jeff | last post by:
Banging my head against the wall trying to figure this out. I have a 'sometimes' hang while disposing a form which contains an ActiveX control (Flash.ocx version 7). The form's Dispose() method...
3
by: lalekse | last post by:
Hi there. I've been searching for 2 days now a way to load a resource (byte) into a Flash Player 9 ActiveX Container. I've found a lot of discussions, talking about IBindHost, IManiker and so...
2
by: pavanip | last post by:
Hi, I developed a windows application in Vb.Net 2003.It is working fine in this. But when I am trying to convert this into .Net 2005 I am getting this error. Class not registered...
0
vekipeki
by: vekipeki | last post by:
Does anyone know if there is a way to set a custom mouse cursor for an ActiveX control in .Net? I am adding some mouse functionality to an existing ActiveX control, and would like to change the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.