Re: Can two interfaces have methods with the same name but different arguments?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 01/13/05


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
>
> 


Relevant Pages

  • Re: How the dispids are assigned to functions?
    ... an excellent explanation of Automation and IDispatch. ... DISPIDs ... I know that the assignment takes place inside the GetIDsOfNames ...
    (microsoft.public.win32.programmer.ole)
  • Re: MS Access and VB.NET
    ... to use automation and invoke a VBA procedure in the mdb to do it. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MS Access and VB.NET
    ... to use automation and invoke a VBA procedure in the mdb to do it. ...
    (microsoft.public.dotnet.framework)
  • How to invoke a software action?
    ... I'm trying to figure out how to invoke a software action from the program ... I'm developing(MS Win2000, VisualStudio 6). ... now the only thing I was able to find is to use a mouse click automation ...
    (comp.lang.cpp)
  • Howto invoke a software action?
    ... I'm trying to figure out how to invoke a software action from the program ... the only thing I was able to find is to use a mouse click automation ... Luca ...
    (comp.programming)