Applied to a parameter or field to indicate the COM alias for the parameter or field type.
Object
Attribute
ComAliasNameAttribute
[Visual Basic] Public Class ComAliasNameAttribute Inherits Attribute [C#] public class ComAliasNameAttribute : Attribute [C++] public __gc class ComAliasNameAttribute : public Attribute [JScript] public class ComAliasNameAttribute extends Attribute
Can be used to attribute parameters, fields or return values.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll
In the following type library OLE_COLOR is an alias for int. During import the arguments of the Color accessor are marked with the ComAliasNameAttribute to indicate that type library refers to them as OLE_COLOR.
[C#]
typedef int OLE_COLOR; interface Bar { HResult SetColor([in] OLE_COLOR cl); HResult GetColor([out, retval] OLE_COLOR *cl); }
imported as:
[C#]
interface Bar { void SetColor([ComAliasName("stdole.OLE_COLOR")]] int cl); [ComAliasName("stdole.OLE_COLOR")] in GetColor(); }
ComAliasNameAttribute Members | System.Runtime.InteropServices Namespace