How to derive all offered interface types from an COM idl?
See the question and my original answer on StackOverflow1) because the dispid is a well-known one: DISPID_NEWENUM (-4) that designates an enumerator. The item's type (IVariable
) can be deduced from the Item
(the indexer) member which uses 0 (DISPID_VALUE).
DISPID_NEWENUM -4
This MUST designate the DISPID associated with a _NewEnum method that MUST have the following signature.
HRESULT _NewEnum([out,retval] IEnumVARIANT** ppenum);
or
HRESULT _NewEnum([out,retval] IUnknown** ppenum);
2) yes, if the property type is specified in the idl (duh), but here you're looking at a pure late-binding interface (IDispatch
only), which is fully dynamic, so no, in this case.
3) .IDL
is not used because the .TLB
format is equivalent, and programmable through ITypeLib et al. Only the MIDL compiler uses IDL. At runtime, there's not much more than the TLB available in the general case. COM in its simplest form basically only needs IUnknown
and that's it.