473,320 Members | 1,746 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,320 software developers and data experts.

Q: Is there a C# equilent to vbs ComClass?

Hi!

I have done a couple of ComClasses in vb, and from now on i want to code
ComClasses in C#
is there an equilent of this in c#? If not how to proceed to get the same
functionallity to be able to expose the com class?

Regards
Martin
Nov 30 '06 #1
1 3142
Kev
Hello,

I think from what you are asking you want to use C# to create a component
that appears to be a COM object - usable with classic VB and Component
Services etc. Your explanation is a little vague...

If so you need to create a CCW (COM Callable Wrapper) for your class. This
allows .Net apps use it as a .Net object, and COM clients as a COM object.

The process is roughly:

1 - Create your class (DLL)
2 - Create an interface to it
3 - Add some COM specific attributes
4 - Mark your class as implementing the interface

Note there are some limitations eg: you can't expose C# public static
methods using an interface (something I spent the last few days working
around).

I'll let you mull over that for a while. If you are stuck post back and tell
us how far you got.

Cheers!
"Martin Arvidsson" <ye*******@ms.comwrote in message
news:uF**************@TK2MSFTNGP04.phx.gbl...
Hi!

I have done a couple of ComClasses in vb, and from now on i want to code
ComClasses in C#
is there an equilent of this in c#? If not how to proceed to get the same
functionallity to be able to expose the com class?

Regards
Martin

Dec 1 '06 #2

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

Similar topics

5
by: Michael Lawrence | last post by:
I am looking to start up a comprehensive Adult dating website and I need pre-made PHP scripts to set up the back-end for this project. Preferably someone out there has a set of pre-made scripts...
5
by: Bosconian | last post by:
I need to make an associated array (all with the same key name) using values from another array. Is there a more efficient way to doing this in one pass (instead of looping)? I'm always looking...
7
by: MrKrinkle | last post by:
mysqli has mysqli_more_results(). What is the equivalent function in the older mysql extension?
1
by: A | last post by:
Hi, I have a program that downloads some web pages. Sometimes there is a poor internet connection and my script freezes( hangs) and does not download ALL pages. Is there any solution how to test...
36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
44
by: Tolga | last post by:
As far as I know, Perl is known as "there are many ways to do something" and Python is known as "there is only one way". Could you please explain this? How is this possible and is it *really* a...
5
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a...
6
by: Alvin Bruney [MVP] | last post by:
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...
5
by: Lou | last post by:
How do I add comments to my public functions so the show up in the object browser? Something like in the Object viewer: Function IsMissing(ArgName) As Boolean Member of VBA.Information Returns...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.