Re: Can two interfaces have methods with the same name but different arguments?
From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 01/13/05
- Next message: Igor Tandetnik: "Re: Utility to view Compound Files?"
- Previous message: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- In reply to: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Next in thread: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Reply: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 10:19:28 -0800
Consider the fact it may not be described altogether in the
type library. The information you get back is advisory only.
The rules in Automation are not as rigid as in COM - the
implementation can stretch them. A dispinterface is really
only a collection of methods and properties with their
DISPIDs exposed by a particular implementation of IDispatch.
Its flexible as to the specific names and DISPIDs and can
even fluctuate during the lifetime of a sinlge object instance.
Also note, the same DISPIDs may have different names
depending on the language you call the dispinterface from
(Automation is multilingual). In Automation you can bind
to the interface early using hardcoded DISPIDs, and late -
using names. The former is only possible using a type library
(what you are targeting it seems). The latter always works
since it is done at runtime and does not need a type library.
That's what I suggested you use.
-- ===================================== Alexander Nickolov Microsoft MVP [VC], MCSD email: agnickolov@mvps.org MVP VC FAQ: http://www.mvps.org/vcfaq ===================================== "David Liebtag" <DavidLiebtag@vermontel.net> wrote in message news:1105638958.744975@vader.vermontel.net... > Ok. That's what I thought. (We're finally getting back to where I > started from with this whole line of questioning,,,) > > So. Suppose I have a CLSID and from it I create an IDispatch pointer and > it does indeed have TypeInfo,,, > > How do I get the list of methods and properties I can access through the > IDispatch pointer's Invoke method? > > I have determined this explicitly: > > Using a ProgID of Excel.Application to get the CLSID, the TypeInfo > returned by IDispatch::GetTypeInfo yields a variety of FuncDesc > structures, but not all the ones I know I can invoke. For example, I can > invoke the Dollar method, but it is not listed in any of the FuncDesc's > returned by the TypeInfo. > > I suspect I have to do a GetContainingTypeLib and query all the TypeInfos > in the TypeLib, but how do I know which ones I can actually call using the > original IDispatch::Invoke? > > Thanks in advance. > > David Liebtag > >
- Next message: Igor Tandetnik: "Re: Utility to view Compound Files?"
- Previous message: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- In reply to: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Next in thread: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Reply: David Liebtag: "Re: Can two interfaces have methods with the same name but different arguments?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|