Re: Dual interface
"George" <George@discussions.microsoft.com> wrote in message
news:4D8CC56E-91F2-4EDC-A2B6-15F51F7CED80@microsoft.com
- STDMEDIUM::pUnkForRelease holds a pointer of IUnknown, I agree and
understand;
- But the pointer to IUnknown should actually pointed to some coclass
object, correct?
Correct.
- If yes, the coclass object as you said only implements IUnknown;
Quite possibly.
- So, we can only call its AddRef/Release.
Well, and QueryInterface, though it would be rather pointless if the
only interface you could query for is again IUnknown.
So, it is a component
meaningful which only expose AddRef/Release methods?
Yes.
The component only expose AddRef/Release
only be able to maintain a reference count of itself
Not true. There's no law saying that the only thing Release does is
maintain the object's own reference count. At the very least, it deletes
the object itself when its reference count reaches zero, and can also
perform other cleanup.
while never be
able to do anything else?
Why can't it do anything else?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925