Ciao primo,
I will start from the bottom.
If you press F1 in thinAir while cursor is over iDispatch term, you will get some help I've written.
Anyway iDispatch is standard interface developed over COM.
COM stands for "Component Object Model". In a few words you can think about it as a common interface to be able to talk with binary objects without having any info about that objects.
It is the Microsoft way to interconnect software using a common interface. These interfaces are defined in a COM Object.
If you want to use some function that are inside a DLL, you need to know exactly function name, function return type, number of function parameters, their type, their passing way (byref or byval), ... you need to know everything before being able to call that function. With a COM object you do not need anything, just the registered name of the object is enough because the object is able to describe itself using a common binary interface.
There are many sources on the web you can find talking about ActiveX, COM, iUnknown, iDIspatch, iTypeLib, ... you can stay one year studying about it and still you will have something new to learn for other years
As an introduction, have a look at http://pubs.opengroup.org/onlinepubs/009899899/
A great book can be "Inside COM" from Don Box: https://www.amazon.com/Essential-COM...BBBNRXCVCB1EGW
That said, back to your first question: how to know what a COM object interface instantiated inside an iDispacth variable exposes to the programmer?
Answer is easy and complicated at the same time.
- In general any component developed by Microsoft like Scripting.Dictionary is documented by Microsoft.
For example Scripting component is documented at https://msdn.microsoft.com/en-us/lib...(v=vs.84).aspx
In that page you will find that Scripting implements some objects and one of those is Dictionary interface: https://msdn.microsoft.com/en-us/lib...(v=vs.84).aspx
And there you will find what Properties and Methods that interface implements.
Here https://msdn.microsoft.com/en-us/lib...(v=vs.84).aspx your question: Exists method
So, first reply is: search on the web inside developer of the COM object you are using.
.- Another option is to use a COM Object Browser.
A COM Browser is an application that can be used to browse all registered COM objects, and all objects that support Ole Automation interface.
Have a look at this page https://www.autoitscript.com/autoit3...tro/ComRef.htm and check "OLE/COM Object Viewer" chapter
.- I'm finishing to adapt to thinBasic a COM Browser developed by José Roca and generously released as Freeware: see image
With this browser you will be able to get information about installed COM components and what automation interfaces they implements and for each of them what properties and method they have. And for each of them what parameters they need ...
Hope to have answered to some of your needs.
I just started to study this development area and at every turn I discover a complete new world.
Ciao
Eros
Bookmarks