NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ComAliasNameAttribute Class

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

Remarks

Can be used to attribute parameters, fields or return values.

Requirements

Namespace: System.Runtime.InteropServices

Assembly: mscorlib.dll

Example [C#]

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();
}

See Also

ComAliasNameAttribute Members | System.Runtime.InteropServices Namespace