Re: Problem mit Copy-Klasse in CComEnumOnSTL

From: Holger Grund (h.grund_at_ixtraclick.net)
Date: 02/11/04


Date: Thu, 12 Feb 2004 00:19:41 +0100

Hallo!

> ich habe ein Problem bei der Erstellung eines IEnumString-Enumerators. Ich
> verwende CComEnumOnSTL und eine eigene Copy-Klasse. In dieser wird
> allerdings nur copy aufgerufen, init und destroy nie. init brauche ich
nicht
> einmal zu definieren. Ist das ein Bug oder mache ich irgendwas verkehrt?
Der
> Enumerator funktioniert übrigens.
Kein Bug. Init wird nicht benötigt. Destroy wird nur aufgerufen, falls
copy fehlschlägt (Z.b. du rufst Next auf und willst zwei Elemente,
erstes klappt zweites nicht. Das erste muß wieder freigegeben
werden)

> Dann habe ich noch eine Frage zur copy Funktion. Kann ich dort einfach new
> verwenden oder muss man dort CoTaskMemAlloc verwenden?

CoTaskMemAlloc ist angebracht. Der Client bekommt ja einen
Pointer auf den String und mit diesen laut COM Regeln über
den COM Allocator freigeben.

-hg



Relevant Pages

  • Re: Matlab & LD_LIBRARY_PATH
    ... This happens on different machines running either ... bug, but I can't find it now. ... The question is, when logging in via the display manager, does ... However booting into X11 (init 5) prevents LD_LIBRARY_PATH from ...
    (Fedora)
  • Re: [BUG] get_rtc_time() triggers NMI watchdog in hpet_rtc_interrupt()
    ... but occasionally also early in init. ... The bug may not originate from the 2.6.27-rc series as I only recently ... enabled HPET in this machine's kernels (not due to HPET problems, ... I also just got this during shutdown: ...
    (Linux-Kernel)
  • Re: Bug? in SUSE 9.2 console or init 3 windows button
    ... Was garbled sys info and system state. ... init 3 keeps you from being stuck in an annoying graphic boot. ... The bug is for the install to default to graphic boot. ...
    (alt.os.linux.suse)
  • 2.6.0-test6: more __init bugs
    ... Here are some cases where __init code or data is referenced by ... Ditto for Scsi_Host_Template.detect? ... ** Probably a bug: ... Fix: ...
    (Linux-Kernel)
  • Initializing Servlets
    ... servlet's init() method can be expected? ... I want to open a file that is available for any servlet thread to ... initand destroy() methods? ...
    (comp.lang.java.programmer)