Wha开发者_开发技巧t is an interface connected to a com object?
Each object implements one or more COM interfaces.
A COM interface is a fixed description of what an object can do - in terms of C++ that's a class without member variables and with pure virtual member functions only. A COM class is an implementation of one or more interfaces - in terms of C++ it's a class (usually with member variables) with actually implemented member functions.
When you say that a COM class "has" some COM interfaces it means that it implements them and can retrieve a pointer to each of those interfaces - that's very similar to an upcast in terms of C++, but is done with IUnknown::QueryInterface()
function of the actual COM class.
"COM Interfaces The separation between service user and implementation is done by indirect function calls. A COM interface is nothing more than a named table of function pointers (methods), ..."
See more information at The COM Programmer's Cookbook
精彩评论