Re: A puzzling question
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 03/05/04
- Next message: Igor Tandetnik: "Re: CComObject::CreateInstance, style guidance"
- Previous message: Igor Tandetnik: "Re: EXCEPINFO"
- In reply to: Simon Trew: "Re: A puzzling question"
- Next in thread: Simon Trew: "Re: A puzzling question"
- Reply: Simon Trew: "Re: A puzzling question"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 09:31:48 -0500
"Simon Trew" <ten.egnaro@werts> wrote in message
news:ehgcoxoAEHA.220@TK2MSFTNGP09.phx.gbl...
> "Igor Tandetnik" <itandetnik@mvps.org> wrote in message
> news:OKwHYohAEHA.3048@tk2msftngp13.phx.gbl...
> > It _is_ handled this way. Or rather, IUnknown is not remoted at
all -
> > it's a [local] interface. Except for the final Release, the proxy
can
> > satisfy any IUnknown calls locally.
>
> Well, on a call to CoCreateInstance, you specify the interface you
want
> back, right? So wouldn't COM have to call QI remotely once if a client
QI'd
> for the IUnknown when it specified a different interface to
> CoCreateInstance?
QueryInterface for IUknown is always satisfied locally, and returns an
IUnknown implementation of the proxy manager. Precisely to maintain COM
identity rule.
(Because of the IUnknown identity rule.) Alternately, COM
> would have to specify IID_IUnknown to the remote server's
CoCreateInstance,
> and then remotely QI for the interface that the client specified (this
could
> of course be wrapped in one remote call in the implementation of COM).
That's pretty much what happens. One remote call establishes the
connection between the local proxy manager and the server-side stub, and
retrieves the first interface. In fact, the internal protocol supports
retrieving an arbitrary number of interfaces in a single remote call -
this functionality is exposed via CoCreateInstanceEx. On the server
side, COM runtime does a vanilla CoCreateInstance followed by several
QueryInterface calls, then marshals the whole thing back to the client.
> But
> anyway, I don't think that that would definitely be equivalent
(because the
> guarantees for IUnknown don't have to apply to other interfaces).
I'm not sure what you are saying here. Can you explain a specific
scenario that worries you?
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
- Next message: Igor Tandetnik: "Re: CComObject::CreateInstance, style guidance"
- Previous message: Igor Tandetnik: "Re: EXCEPINFO"
- In reply to: Simon Trew: "Re: A puzzling question"
- Next in thread: Simon Trew: "Re: A puzzling question"
- Reply: Simon Trew: "Re: A puzzling question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|