Jun 30, 2010, 8:41:20 AM6/30/10
I'm re-implementing part of the glue between our in-house scripting
language and OLE automation. I've written a piece of code that reads
ITypeInfo and caches its members for every interface pointer that's
used in a script. I use the cached info to convert names into
for calls to Invoke and for parameter count checking.
We also implement a for-each style enumerator on IEnumVARIANT
To retrieve the IEnumVARIANT, I invoke DISPID_NEWENUM on the object
which the for-each is attempted. This code recently started to fail.
found that this failure is due to the fact that I now first check
call (whether over name or over DISPID) against my cached type info,
and fail when the member cannot be found. If I skip the check, the
call works fine.
Looking further, it turns out that the Microsoft Outlook 12.0 type
library doesn't seem to define the _NewEnum member at all for the
_Items interface. The interface does define Count and Item, and
blindly invoking DISPID_NEWENUM on it actually succeeds, but
to the type library (I also checked using OleView) this member
shouldn't exist at all.
This seems to imply that any call that isn't defined by the type
library might still succeed, and that I cannot rely on the type