Skip to Content
.NET and COM Interoperability Handbook, The
book

.NET and COM Interoperability Handbook, The

by Alan Gordon
December 2002
Intermediate to advanced
720 pages
17h 39m
English
Pearson
Content preview from .NET and COM Interoperability Handbook, The

ComVisible

You can specify which members of your classes will be visible to unmanaged (COM) clients using the ComVisible attribute, which resides in the System.Runtime.InteropServices namespace. To specify that a property or method should be visible to COM, set ComVisible to true as follows:

[ComVisible(true)]
public void DoSomething()
{
// Do something...
}

To specify that a property or method should not be visible to COM, set ComVisible to false as follows:

[ComVisible(false)]
public void DoSomething()
{
// Do something...
}

The ComVisible attribute can be applied to a class, structure, enumeration or an entire assembly. It can also be applied to any of the members of a type such as a method, property, field, interface or delegate. You ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

.NET and COM: The Complete Interoperability Guide

.NET and COM: The Complete Interoperability Guide

Adam Nathan
Professional C# 5.0 and .NET 4.5.1

Professional C# 5.0 and .NET 4.5.1

Christian Nagel, Jay Glynn, Morgan Skinner

Publisher Resources

ISBN: 013046130XPurchase book