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

example to write a COM component in C#?

Could anyone know where I can find example to write a COM
component / ActiveX control in C# which can be used by
VB6/VC6?
Nov 15 '05 #1
2 4607
And the super-short version of the key elements... in the project
properties, you enable COM Interop.. then you us the ComVisible attribute
above everything you want to be..... you guessed it, visibel from COM:

[ComVisible(true)]
class MyClass
{
[ComVisible(true)]
public void SomeFunc()
{
}
}

And there is some attribute at the Class level - where you specify what the
ProgID should be.. aside from that, this is the short course...
"Chris Taylor" <ch*************@hotmail.com> wrote in message
news:uF*************@TK2MSFTNGP10.phx.gbl...
Hi,

The following link should be a good starting point,

http://msdn.microsoft.com/library/de...nentstocom.asp
Watch for line wrap!

Hope this helps

Chris Taylor

"kathy" <ka***@nospam.com> wrote in message
news:10****************************@phx.gbl...
Could anyone know where I can find example to write a COM
component / ActiveX control in C# which can be used by
VB6/VC6?


Nov 15 '05 #2
Hi,

You still have to run Regasm.exe /tlb... for the typelib to be generated and
registered.

Having ComVisible(true) for everything is the same as having no attribute at
all.

<quote source="msdn">
This attribute is not needed to make public managed assemblies and types
visible; they are visible to COM by default.
</quote>

Regards

Chris Taylor

"Drebin" <tR*************@hotmail.com> wrote in message
news:fa**********************@newssvr28.news.prodi gy.com...
And the super-short version of the key elements... in the project
properties, you enable COM Interop.. then you us the ComVisible attribute
above everything you want to be..... you guessed it, visibel from COM:

[ComVisible(true)]
class MyClass
{
[ComVisible(true)]
public void SomeFunc()
{
}
}

And there is some attribute at the Class level - where you specify what the ProgID should be.. aside from that, this is the short course...
"Chris Taylor" <ch*************@hotmail.com> wrote in message
news:uF*************@TK2MSFTNGP10.phx.gbl...
Hi,

The following link should be a good starting point,

http://msdn.microsoft.com/library/de...nentstocom.asp

Watch for line wrap!

Hope this helps

Chris Taylor

"kathy" <ka***@nospam.com> wrote in message
news:10****************************@phx.gbl...
Could anyone know where I can find example to write a COM
component / ActiveX control in C# which can be used by
VB6/VC6?



Nov 15 '05 #3

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

Similar topics

3
by: Angelos Karantzalis | last post by:
Hi y'all, recently I've come across a situation where a web service needs to deal with an exception that might arise, originating from a COM+ component. It then returns an int value (please...
5
by: mony | last post by:
I am looking a VB.NET example on how to reference the SNMP API information. I am unable to add references to SNMPAPI.LIB or SNMPAPI.DLL. My goal is to write a 100% VB.NET example (no C or C#...
2
by: yaron | last post by:
Hi, I am writing a new networking component (dll). I have a few questions : 1. if i write it with .NET 2 , am i decreasing the number of potentials clients of my component ? 2. if the API to...
2
by: Angie | last post by:
Hi, all, I’m newbie in .net, does any expert help me on the following questions? Thanks I have a DLL file wrote in Visual C++ 6.0 for sending message from one server to the other server, and...
10
by: kathy | last post by:
In VB.NET help file "Walkthrough: Creating COM Objects with Visual Basic .NET", It said: "Note The COM objects you generate with Visual Studio .NET cannot be used by other Visual Studio .NET...
7
by: Dr. Zharkov | last post by:
We have program Visual Basic .NET 2003 for construction of 3D-Graphics as a surface z=f (x, y). From VB .NET 2003 we want to transfer coordinates of this surface as myArrayVB (2000, 1) in myArrayVó...
0
by: todddeluca | last post by:
I am posting code for calling almost any python function from php, because it seems generally useful. Please feel free to suggest improvements or tell me this has already been done better...
1
by: masterchike | last post by:
Hello All: I am really in a bind. I need to AJAXify a web page that contains a charting component (ILOG). Unfortunately, charting component uses document.write() to write some divs and tags so I...
3
by: Rudi | last post by:
Hello, following problem: At program end or release an assembly a serial device should get a final exit sequence. How can I do this? With Dispose() it's no problem, but this assembly is used...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.