The DispId attribute can be passed certain values which confer specific meaning to any consumers of a COM object.
e.g., here is one example.
Typical advice seems to be to just hardcode whichever "magic number" suits your purpose. But since .NET included the DispIdAttribute
I was expecting a list of constants to go along with it - but haven't been able to find one. Does such a thing exist?
For the record the DispId values I'm talking about are:
DISPID_COLLECT -8
DISPID_CONSTRUCTOR -6
DISPID_DESTRUCTOR -7
DISPID_EVALUATE -5
DISPID_NEWENUM -4
DISPID_PROPERTYPUT -3
DISPID_UNKNOWN -1
DISPID_VALUE 0
ref https://msdn.microsoft.com/en-us/library/windows/desktop/ms221242(v=vs.85).aspx
I just used .NET Reflector to search for "dispid" in all assemblies in the .NET framework. It would appear that there are no public consts or enums that expose these standard DISPIDs. There are a couple of internal classes -- System.Dynamic.ComDispIds
and System.Windows.Forms.NativeMethods+ActiveX
-- that expose these constants, but you cannot get at them without reflection.