Re: ATL-COM: return pointer to instance

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Joe (joerider_at_uboot.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 11:23:13 +0100

thatsalok schrieb:
> STDMETHODIMP Ctest::getTest(Itest* *t)
> {
> Ctest *parent = ...;
> *t = parent;
> return S_OK;
> }
It seems, it was too simple to see!

Who destroys the upper *parent-Instance?

In my program a tree is built with items

tree
   |-item (root)
      |-item
        |-item
      ...
      |-item
        |-item
        |-item

This structure is already existing. For reusability I'd like to create
an ATL-COM around this tree. Let's call it CTree with the Interface
ITree. The items should be provided with CItem and IItem. Now, as you
might know, I don't want to rebuild the existing tree. Therefor, I need
to create instances of CItem within CTree to make them accessable. But
where do i delete those instances?

I think, I should use pointers in CItem that points at an item-instance.

Thanks for hints,
Joe



Relevant Pages

  • Re: Math as Religion
    ... advanced math course isn't just given as doctrine, ... A tree has been built. ... fundamentals at its base. ...
    (sci.math)
  • Re: Share Your Childhood ?
    ... trees when I was a kid and never fell out of one. ... When I was 9 or 10 we built a fort using grain boards from the ... My girlfriends and I slept in that fort several times. ... Some boys built a tree fort accessable only by climbing a long rope. ...
    (soc.senior.issues)
  • Re: Share Your Childhood ?
    ... When I was 9 or 10 we built a fort using grain boards from the ... My girlfriends and I slept in that fort several times. ... Some boys built a tree fort accessable only by climbing a long rope. ...
    (soc.senior.issues)
  • Re: [PATCH] gpiolib: Allow user-selection
    ... architecture code didn't request to get it built in. ... I assume this patch was prepared against some ancient out-of-date ... But what I am repeatedly seeing is people cheerfully raising 2.6.27 ... patches against the 2.6.26 tree when we have a nice 2.6.27 tree for ...
    (Linux-Kernel)
  • Re: Noahs Ark false comparison
    ... tree large enough to make into a 300-cubit keel, ... couldn't the Ark have been built? ...
    (talk.origins)