ComClass() absent in C# why?

A

Alvin Bruney [MVP]

Before I go shooting my mouth I'd like to find out why a new language like
C# does not have the ComClass attribute that is available in Visual Basic.

For context, the absence of the ComClass attribute in C# makes writing
ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
 
N

Nicholas Paldino [.NET/C# MVP]

Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to expose
COM objects anyways. In reality, you should be using the Guid attribute to
assign the CLSID to the implementation and the IID to the interface, as well
as defining your interfaces and implementing them on your class (and using
the ProgId attribute as well as the ClassInterface attribute).

Finally, .NET does not support exporting ActiveX controls. COM objects,
yes, but ActiveX controls, no. You can do it with a workaround, but it is
unsupported by MS.
 
A

Alvin Bruney [MVP]

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a workaround,
but it is unsupported by MS.
What exactly does this mean? Technically speaking. And what is the
workaround? Currently, I have an open ticket with MS and they can't figure
out how to sink events in Internet Explorer using VS 05 and ActiveX controls
and C# so any tidbit you can give to this two week old problem will be
helpfull.
The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.
Ya we already tried the VisualBasic namespace import, but that was just a
waste of paper. Curious to find out why it didn't work as well. Same code
works a treat in VS 03 or VS 05 and Visual Basic. No joy in VS 05 and C#.
In reality, you should be using the Guid attribute to assign the CLSID to
the implementation and the IID to the interface, as well as defining your
interfaces and implementing them on your class (and using the ProgId
attribute as well as the ClassInterface attribute).
That doesn't work. Events are fired in the control but don't sink in IE with
C# and 05
--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to expose
COM objects anyways. In reality, you should be using the Guid attribute
to assign the CLSID to the implementation and the IID to the interface, as
well as defining your interfaces and implementing them on your class (and
using the ProgId attribute as well as the ClassInterface attribute).

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a workaround,
but it is unsupported by MS.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alvin Bruney said:
Before I go shooting my mouth I'd like to find out why a new language
like C# does not have the ComClass attribute that is available in Visual
Basic.

For context, the absence of the ComClass attribute in C# makes writing
ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
N

Nicholas Paldino [.NET/C# MVP]

Avlin,

See inline.
What exactly does this mean? Technically speaking. And what is the
workaround? Currently, I have an open ticket with MS and they can't figure
out how to sink events in Internet Explorer using VS 05 and ActiveX
controls and C# so any tidbit you can give to this two week old problem
will be helpfull.

It means that you can not export ActiveX controls from .NET. If you
search google, you will find a workaround posted out there. However,
Microsoft does not officially support this, so if you find quirks, or that
certain things that don't work, you are out of luck, you won't get support.
Ya we already tried the VisualBasic namespace import, but that was just a
waste of paper. Curious to find out why it didn't work as well. Same code
works a treat in VS 03 or VS 05 and Visual Basic. No joy in VS 05 and C#.
That doesn't work. Events are fired in the control but don't sink in IE
with C# and 05

Right, but you aren't supposed to be exporting .NET controls as ActiveX
controls in the first place with IE. If you want to host controls from .NET
in IE, then I would do it the correct way:

http://windowsforms.net/articles/iesourcing.aspx

Of course, this requires that you have a Windows platform, as well as
..NET installed.

Instead of this, I would recommend pushing a smart client out to the
user. You can give them a better experience than a web page, IMO, and you
already fufill the requirements (you know you are on a Windows platform with
the framework installed already).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to expose
COM objects anyways. In reality, you should be using the Guid attribute
to assign the CLSID to the implementation and the IID to the interface,
as well as defining your interfaces and implementing them on your class
(and using the ProgId attribute as well as the ClassInterface attribute).

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a workaround,
but it is unsupported by MS.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alvin Bruney said:
Before I go shooting my mouth I'd like to find out why a new language
like C# does not have the ComClass attribute that is available in Visual
Basic.

For context, the absence of the ComClass attribute in C# makes writing
ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
A

Alvin Bruney [MVP]

Thanks for that link. That's how I'm doing it. I guess this is a bug with C#
and Visual Studio 05.
You can give them a better experience than a web page, IMO,
Where I work, we are exploring embedded controls in web forms as an
alternative to reducing the enormous cost of maintaining and troubleshooting
installation problems associated with windows forms applications in the
enterprise. Every new windows app rolled out to 20,000 desktops result in a
flood of support issues that is an increasing burden on the order of several
million dollars.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

See inline.
What exactly does this mean? Technically speaking. And what is the
workaround? Currently, I have an open ticket with MS and they can't
figure out how to sink events in Internet Explorer using VS 05 and
ActiveX controls and C# so any tidbit you can give to this two week old
problem will be helpfull.

It means that you can not export ActiveX controls from .NET. If you
search google, you will find a workaround posted out there. However,
Microsoft does not officially support this, so if you find quirks, or that
certain things that don't work, you are out of luck, you won't get
support.
Ya we already tried the VisualBasic namespace import, but that was just a
waste of paper. Curious to find out why it didn't work as well. Same code
works a treat in VS 03 or VS 05 and Visual Basic. No joy in VS 05 and C#.
That doesn't work. Events are fired in the control but don't sink in IE
with C# and 05

Right, but you aren't supposed to be exporting .NET controls as ActiveX
controls in the first place with IE. If you want to host controls from
.NET in IE, then I would do it the correct way:

http://windowsforms.net/articles/iesourcing.aspx

Of course, this requires that you have a Windows platform, as well as
.NET installed.

Instead of this, I would recommend pushing a smart client out to the
user. You can give them a better experience than a web page, IMO, and you
already fufill the requirements (you know you are on a Windows platform
with the framework installed already).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to
expose COM objects anyways. In reality, you should be using the Guid
attribute to assign the CLSID to the implementation and the IID to the
interface, as well as defining your interfaces and implementing them on
your class (and using the ProgId attribute as well as the ClassInterface
attribute).

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a
workaround, but it is unsupported by MS.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
Before I go shooting my mouth I'd like to find out why a new language
like C# does not have the ComClass attribute that is available in
Visual Basic.

For context, the absence of the ComClass attribute in C# makes writing
ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
N

Nicholas Paldino [.NET/C# MVP]

Alvin,

It's not a bug. Initially, in the first version of the framework, they
desired to have the ability to export to ActiveX controls, so a good deal of
code is there to support that. However, before they released, they pulled
this feature. They just didn't take out all of the code that was used to
support it.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alvin Bruney said:
Thanks for that link. That's how I'm doing it. I guess this is a bug with
C# and Visual Studio 05.
You can give them a better experience than a web page, IMO,
Where I work, we are exploring embedded controls in web forms as an
alternative to reducing the enormous cost of maintaining and
troubleshooting installation problems associated with windows forms
applications in the enterprise. Every new windows app rolled out to 20,000
desktops result in a flood of support issues that is an increasing burden
on the order of several million dollars.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

See inline.
Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a
workaround, but it is unsupported by MS.
What exactly does this mean? Technically speaking. And what is the
workaround? Currently, I have an open ticket with MS and they can't
figure out how to sink events in Internet Explorer using VS 05 and
ActiveX controls and C# so any tidbit you can give to this two week old
problem will be helpfull.

It means that you can not export ActiveX controls from .NET. If you
search google, you will find a workaround posted out there. However,
Microsoft does not officially support this, so if you find quirks, or
that certain things that don't work, you are out of luck, you won't get
support.
The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.
Ya we already tried the VisualBasic namespace import, but that was just
a waste of paper. Curious to find out why it didn't work as well. Same
code works a treat in VS 03 or VS 05 and Visual Basic. No joy in VS 05
and C#.

In reality, you should be using the Guid attribute to assign the CLSID
to the implementation and the IID to the interface, as well as defining
your interfaces and implementing them on your class (and using the
ProgId attribute as well as the ClassInterface attribute).
That doesn't work. Events are fired in the control but don't sink in IE
with C# and 05

Right, but you aren't supposed to be exporting .NET controls as
ActiveX controls in the first place with IE. If you want to host
controls from .NET in IE, then I would do it the correct way:

http://windowsforms.net/articles/iesourcing.aspx

Of course, this requires that you have a Windows platform, as well as
.NET installed.

Instead of this, I would recommend pushing a smart client out to the
user. You can give them a better experience than a web page, IMO, and
you already fufill the requirements (you know you are on a Windows
platform with the framework installed already).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


in message Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you no
good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to
expose COM objects anyways. In reality, you should be using the Guid
attribute to assign the CLSID to the implementation and the IID to the
interface, as well as defining your interfaces and implementing them on
your class (and using the ProgId attribute as well as the
ClassInterface attribute).

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a
workaround, but it is unsupported by MS.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
Before I go shooting my mouth I'd like to find out why a new language
like C# does not have the ComClass attribute that is available in
Visual Basic.

For context, the absence of the ComClass attribute in C# makes writing
ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
A

Alvin Bruney [MVP]

to update this thread, the event sinks in internet explorer do work
correctly. there's a few more attributes to add for c# but the end resulting
functionality is equivalent.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Alvin,

It's not a bug. Initially, in the first version of the framework, they
desired to have the ability to export to ActiveX controls, so a good deal
of code is there to support that. However, before they released, they
pulled this feature. They just didn't take out all of the code that was
used to support it.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alvin Bruney said:
Thanks for that link. That's how I'm doing it. I guess this is a bug with
C# and Visual Studio 05.
You can give them a better experience than a web page, IMO,
Where I work, we are exploring embedded controls in web forms as an
alternative to reducing the enormous cost of maintaining and
troubleshooting installation problems associated with windows forms
applications in the enterprise. Every new windows app rolled out to
20,000 desktops result in a flood of support issues that is an increasing
burden on the order of several million dollars.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nicholas Paldino said:
Avlin,

See inline.

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a
workaround, but it is unsupported by MS.

What exactly does this mean? Technically speaking. And what is the
workaround? Currently, I have an open ticket with MS and they can't
figure out how to sink events in Internet Explorer using VS 05 and
ActiveX controls and C# so any tidbit you can give to this two week old
problem will be helpfull.

It means that you can not export ActiveX controls from .NET. If you
search google, you will find a workaround posted out there. However,
Microsoft does not officially support this, so if you find quirks, or
that certain things that don't work, you are out of luck, you won't get
support.

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you
no good. The C# compiler will not recognize it.
Ya we already tried the VisualBasic namespace import, but that was just
a waste of paper. Curious to find out why it didn't work as well. Same
code works a treat in VS 03 or VS 05 and Visual Basic. No joy in VS 05
and C#.

In reality, you should be using the Guid attribute to assign the CLSID
to the implementation and the IID to the interface, as well as
defining your interfaces and implementing them on your class (and
using the ProgId attribute as well as the ClassInterface attribute).

That doesn't work. Events are fired in the control but don't sink in IE
with C# and 05

Right, but you aren't supposed to be exporting .NET controls as
ActiveX controls in the first place with IE. If you want to host
controls from .NET in IE, then I would do it the correct way:

http://windowsforms.net/articles/iesourcing.aspx

Of course, this requires that you have a Windows platform, as well as
.NET installed.

Instead of this, I would recommend pushing a smart client out to the
user. You can give them a better experience than a web page, IMO, and
you already fufill the requirements (you know you are on a Windows
platform with the framework installed already).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


"Nicholas Paldino [.NET/C# MVP]" <[email protected]>
wrote in message Avlin,

The attribute is in the Microsoft.VisualBasic namespace, located in
Microsoft.VisualBasic.dll. You can use it in C#, but it will do you
no good. The C# compiler will not recognize it.

Also, I doubt that using that in VB is really the proper way to
expose COM objects anyways. In reality, you should be using the Guid
attribute to assign the CLSID to the implementation and the IID to the
interface, as well as defining your interfaces and implementing them
on your class (and using the ProgId attribute as well as the
ClassInterface attribute).

Finally, .NET does not support exporting ActiveX controls. COM
objects, yes, but ActiveX controls, no. You can do it with a
workaround, but it is unsupported by MS.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

"Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
Before I go shooting my mouth I'd like to find out why a new language
like C# does not have the ComClass attribute that is available in
Visual Basic.

For context, the absence of the ComClass attribute in C# makes
writing ActiveX controls extremely messy and error prone.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 

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