missig _newenum in outlook typelib

3 views
Skip to first unread message

Jan-Jaap Fahner

unread,
Jun 30, 2010, 8:41:20 AM6/30/10
to
Hi,
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
dispids
for calls to Invoke and for parameter count checking.
We also implement a for-each style enumerator on IEnumVARIANT
objects.
To retrieve the IEnumVARIANT, I invoke DISPID_NEWENUM on the object
on
which the for-each is attempted. This code recently started to fail.
I
found that this failure is due to the fact that I now first check
any
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
according
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
library.
What gives?
Jan-Jaap
Reply all
Reply to author
Forward
0 new messages