473,406 Members | 2,698 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,406 software developers and data experts.

How to create COM in C# class lib ?

My company have many release programs written VB6.0 before.
Now, we want to add new functionalities in C#, and relpece old VB6
programs step by step.
Obviously, COM is a good way to do that.

In my program, I just to write a COM with C#, and invok it BV6.0
But I really can't understand why C# doesn't support "COM class"
template.( VB.Net provides this.)

I just want to know how to create COM in C# class lib ,and invoke it in VB6.

Thank you very much:-)

CYShao

Nov 16 '05 #1
2 5264
Hi Shao,

1) Your assembly must have a strong name. Go to the "AssemblyInfo.cs"
file, and change the [assembly: AssemblyTitle("")] to include the name
of your project, like [assembly: AssemblyTitle("NETtoCOM")].

2) Right-click on your project, select the "Common properties" tab,
select "Class Library" as output type.

3) Click on the "Configuration properties tab", and set "Register for
COM Interop" to True.

That should do it.

HTH,
Michel
"CYShao" <ad****@263.net> wrote in message news:<OS**************@TK2MSFTNGP09.phx.gbl>...
My company have many release programs written VB6.0 before.
Now, we want to add new functionalities in C#, and relpece old VB6
programs step by step.
Obviously, COM is a good way to do that.

In my program, I just to write a COM with C#, and invok it BV6.0
But I really can't understand why C# doesn't support "COM class"
template.( VB.Net provides this.)

I just want to know how to create COM in C# class lib ,and invoke it in VB6.

Thank you very much:-)

CYShao

Nov 16 '05 #2
Exposing .NET Framework Components to COM
Short URL: http://shrinkster.com/124
Full URL:
http://msdn.microsoft.com/library/de...nentsToCOM.asp

--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
http://msmvps.com/windsor/
"CYShao" <ad****@263.net> wrote in message
news:OS**************@TK2MSFTNGP09.phx.gbl...
My company have many release programs written VB6.0 before.
Now, we want to add new functionalities in C#, and relpece old VB6
programs step by step.
Obviously, COM is a good way to do that.

In my program, I just to write a COM with C#, and invok it BV6.0
But I really can't understand why C# doesn't support "COM class"
template.( VB.Net provides this.)

I just want to know how to create COM in C# class lib ,and invoke it in VB6.
Thank you very much:-)

CYShao

Nov 16 '05 #3

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

Similar topics

9
by: jon wayne | last post by:
OK! I had this nagging doubt Consider (without worrying abt access specifiers) class Kid : public Parent{...}; Parent::someFunc() { Kid k; }
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: Migrant | last post by:
Hi Friends; I want develop a group logic with C# (n tier refraction).I know I must create a Class and inherit it But I don't have enough know-how about develop classes. Somebody can help me? ...
4
by: Joe HM | last post by:
Hello - I have a Base Class where I want a New() implemented that can be called from the outside. This New() should create an instance of the appropriate cDerivedX Class ... The following...
7
by: MarkoH | last post by:
Wsdl.exe /server creates abstract class derived from WebService. Is there a way to create this class at runtime based on some WSDL file given at runtime ? What would be even better - creating...
37
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
18
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
24
by: M O J O | last post by:
Hi, Instead of doing this.... Public Class Form1 Public Shared Sub CreateAndShow() Dim f As New Form1 f.Show() End Sub
2
by: Angel Of Death | last post by:
I have a method. It takes some XML as a parameter. Depending on the content of the XML it should create a specific object and call a KNOWN method. So: public void PersistXml(string XmlData){} ...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
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: 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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.