Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between IDispatch and IUnkown in COM? [closed]

I have read and saw example for COM, but I couldn't clearly get there Interface difference.

like image 398
mahipal.friends Avatar asked Dec 22 '25 19:12

mahipal.friends


1 Answers

IUnknown is the primal COM interface. It provides the basic ability to "cast" a instance of a COM object to any of it's supported interfaces (QueryInterface).

IDispatch builds on IUnknown adding the facility to discover at run-time the attributes and interfaces supported by the specified COM object. This allows for late-binding and dynamic-binding. A remedial reflection of sorts. With IDispatch, an application can discover the capability of components and invoke discovered methods (which was simplistically called automation).

See Implementing the IDispatch Interface [Automation] on MSDN (resurrected from WayBack Machine - current online version).

like image 136
David Thomas Avatar answered Dec 24 '25 11:12

David Thomas