PC Review


Reply
Thread Tools Rate Thread

ComClass() absent in C# why?

 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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
-------------------------------------------------------



 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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 Removed)

"Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
news:(E-Mail Removed)...
> 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
> -------------------------------------------------------
>
>
>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
> 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 [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:%(E-Mail Removed)...
> 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 Removed)
>
> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
> news:(E-Mail Removed)...
>> 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
>> -------------------------------------------------------
>>
>>
>>

>
>



 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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 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]" <(E-Mail Removed)> wrote
> in message news:%(E-Mail Removed)...
>> 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 Removed)
>>
>> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
>> news:(E-Mail Removed)...
>>> 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
>>> -------------------------------------------------------
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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 [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:%23Z5vJ%(E-Mail Removed)...
> 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 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]" <(E-Mail Removed)> wrote
>> in message news:%(E-Mail Removed)...
>>> 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 Removed)
>>>
>>> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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
>>>> -------------------------------------------------------
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      22nd Jul 2006
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 Removed)

"Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
news:%(E-Mail Removed)...
> 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 [.NET/C# MVP]" <(E-Mail Removed)> wrote
> in message news:%23Z5vJ%(E-Mail Removed)...
>> 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 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]" <(E-Mail Removed)> wrote
>>> in message news:%(E-Mail Removed)...
>>>> 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 Removed)
>>>>
>>>> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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
>>>>> -------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      27th Jul 2006
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 [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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 Removed)
>
> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
> news:%(E-Mail Removed)...
>> 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 [.NET/C# MVP]" <(E-Mail Removed)> wrote
>> in message news:%23Z5vJ%(E-Mail Removed)...
>>> 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 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]" <(E-Mail Removed)>
>>>> wrote in message news:%(E-Mail Removed)...
>>>>> 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 Removed)
>>>>>
>>>>> "Alvin Bruney [MVP]" <www.lulu.com/owc> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> 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
>>>>>> -------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using vb.net collections in VBA through COMClass Jason Microsoft Excel Programming 4 27th Oct 2008 11:56 PM
absent mike Microsoft Access 1 30th Sep 2008 05:42 PM
ComClass Public Function Comments Lou Microsoft VB .NET 6 4th Oct 2007 10:48 PM
Q: Is there a C# equilent to vbs ComClass? Martin Arvidsson Microsoft C# .NET 1 1st Dec 2006 07:05 AM
Sorry I've been absent Wojo Windows XP MovieMaker 0 20th Jun 2006 07:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.