2

I am reworking some code for COM automation. Working with an IDispatch client for Excel (application), I can evaluate

idispatch.GetIDsOfNames('Run' 'Macro' 'Arg1' 'Arg2')

and it works. It returns an array with the memberID of the method for Run (1925 in this version) and the indexes for the arguments Macro, Arg1 and Arg2. But if I try to get the same information from the ITypeInfo, which I obtained sending GetTypeInfo(0) to the same idispatch, it yields an error HRESULT_E_NOTIMPL. Does this function work on ITypeInfo? Documentation says yes...

Carlos E. Ferro
  • 930
  • 10
  • 21
  • 1
    A server that implements IDispatch is *not* obligated to implement GetTypeInfo(). You are supposed to check GetTypeInfoCount() first. When you get 0 then you're done. – Hans Passant Feb 19 '15 at 20:00
  • Yes, I have checked that and it gave me 1. Besides, the ITypeInfo has a valid address and it responds successfully to other messages. I could get from it the type attributes, function descriptions and many other things. Only I could not use this particular function, and that puzzled me. – Carlos E. Ferro Feb 19 '15 at 20:22

0 Answers0