O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ComAliasNameAttribute

Synopsis

This attribute is automatically added when COM type libraries are imported into the .NET runtime. COM uses alias names for various data types (such as typedef [public] int SHOE_SIZE). When you import a COM object that uses such an alias, .NET automatically decorates each parameter, property, field, and return value with this attribute. If you need to know the name of the COM alias, use the System.Reflection API to see if this custom attribute has been attached to the parameter, property, field, or return value you are interested in.

Since .NET automatically converts COM aliases to the underlying .NET types when it imports a type library, you do not need to use this attribute for typical applications (tool developers will find this attribute useful, though).

public sealed class ComAliasNameAttribute : Attribute {
// Public Constructors
   public method ComAliasNameAttribute(string alias);  
// Public Instance Properties
   public field string Value{get; } 
}

Hierarchy

System.ObjectSystem.AttributeComAliasNameAttribute

Valid On

Property, Field, Parameter, ReturnValue

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required