What is an interface connected to a com object?
-
2Do you want documentation links? Are you after something specific?Pontus Gagge– Pontus Gagge2011-02-15 15:03:40 +00:00Commented Feb 15, 2011 at 15:03
-
Ninja OP ! One question per minute.Xavier V.– Xavier V.2011-02-15 15:04:32 +00:00Commented Feb 15, 2011 at 15:04
-
Ist becuase I am going over new code right now and I have a lot of questions.lital maatuk– lital maatuk2011-02-15 15:05:56 +00:00Commented Feb 15, 2011 at 15:05
-
What does "connected" mean here? Do you have any example to illustrate that?sharptooth– sharptooth2011-02-15 15:06:16 +00:00Commented Feb 15, 2011 at 15:06
-
I am not sure myself. Someone wrote that a com object has a few interfaces.lital maatuk– lital maatuk2011-02-15 15:07:29 +00:00Commented Feb 15, 2011 at 15:07
2 Answers
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.
Comments
"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