Re: connection points?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 02/24/04


Date: Tue, 24 Feb 2004 09:35:26 -0500


"Phil Da Lick!" <phil_the_lick@nospam.hotmail.com> wrote in message
news:1WF_b.9812$h44.1099836@stones.force9.net...
> Thanks both, I think what I'll do is just pass a pointer to the
required
> interface into the children. They are defined entirely within the
scope of
> the parent. When the parent dies, the children die as well so this
shouldn't
> be a problem.

What if the client still holds an interface pointer of the element? You
can't have an element destroyed, or the client will crash the moment it
calls anything through that pointer.

> I just wondered whether the "correct" approach was to use a connection
> point, that's all.

Connection points are designed for loosely coupled components -
components that have little or no a-priori knowledge of each other. You
don't really need such a heavy-weight mechanism for tightly coupled
components - components that are designed from the start to integrate
with each other, often on the source code level. You don't even need COM
for that - they can just hold straight C++ pointers to each other.

-- 
With best wishes,
    Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Relevant Pages

  • Re: COM, returned handles, and memory management
    ... how do I pass "an object" across a COM interface? ... > handle (e.g. an interface pointer). ... The client has not done anything with the ... >> RDeW ...
    (microsoft.public.vc.atl)
  • Re: DCOM access from a different domain (yes another accessdenied question)
    ... although I am in complete control of the server application ... CoSetProxyBlanket on my test client, ... You need to establish a security blanket for the received interface ... pointer as those credentials are only good for the activation call. ...
    (microsoft.public.win32.programmer.ole)
  • Re: Firing events from thread across proces
    ... Microsoft MVP, MCSD ... > This component gets created from the client(ServerComp).The client then ... > component that is required by the client is created and it's pointer is ... > Now to solve this problem, I passed the marshalled interface pointer ...
    (microsoft.public.vc.atl)
  • Re: C# DLL mittels COM-Interop aus C aufrufen
    ... Have u tried the IDispatch interface, which is used for those language ... which doesnot have capability of maintaining VTables. ... The __cplusplus symbol is defined automatically when you're compiling C ... appropriate function pointer type. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: Pointers in derived types, help needed
    ... subroutine/function must have an explicit interface. ... C is not a pointer. ... then probably the best thing to do is use allocatables. ...
    (comp.lang.fortran)