Custom attribute to specify the COM DISPID of a Method or Field.
This attribute contains the dispid for the method, field or property it describes. Unique Dispids are typically assigned by the runtime but this attribute can be used to force a specific method to have a specific dispid.
When methods with this attribute are exposed through IDispatch, they are exposed with the dispid specified in the attribute. When importing a typelib, this attribute is applied to all methods with assigned dispids. This ensures that the any managed implementation of the same method would retain the same dispid if exposed to com.
Object
Attribute
DispIdAttribute
[Visual Basic] Public Class DispIdAttribute Inherits Attribute [C#] public class DispIdAttribute : Attribute [C++] public __gc class DispIdAttribute : public Attribute [JScript] public class DispIdAttribute extends Attribute
Can be used to attribute methods, fields or properties.
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll
DispIdAttribute Members | System.Runtime.InteropServices Namespace