
ATL and doing things the wrong way
Hi all:
Thanks to everyone for the help provided on the whole gettting the hwnd of
the container issue. Also,
I have found that the following will work for an ATL windowless control:
HWND hParentWin
m_spInPlaceSite->GetWindow(&hParentWin);
Anyway, here's my latest dilemma. My ActiveX control creates a DirectShow
filter graph. Don't worry, the fact that its DirectShow is not relevant to
the question. A DirectShow filter graph is a COM object, and the filters
(which comprise the graph) are COM objects too. The pins that connect the
filters are also COM objects. The BSTRs that name the filters are also COM
objects, etc, etc, ad nauseaum.
Now, a lot of these bad boys are private data members of my ctrl. After I
am done with the ctrl, where should I release them? The destructor does not
seem to be the appropriate place...I tried that and the debug.dll is
telling me that there are still active objects. FinalRelease() is also not
doing the trick. Can anyone point me in the right direction? Some
explanation of the life cycle of an ActiveX control wouldn't hurt.