> Not so, unless there where static or global smart pointers to COM
> objects.
>
> Don't forget that CoInitialize() starts the COM runtime for the
> thread, not the current scope (although they often end up being the
> same thing).

OK, consider this:

 int main()
 {
  CoInitialize( NULL );
  CComPtr< IX > pX;
  pX.CoCreateInstance( CLSID_X );
  CoUninitialize(); // bummer!
 }

Do you see my point?  If not, try to imagine when CComPtr's dtor is executed.

-------------
Ehsan Akhgari

Farda Technology (www.farda-tech.com)

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

That which an age feels to be evil is usually an untimely after-echo of that
which was formerly felt to be good - the atavism of an older ideal.
-Beyond Good And Evil, F. W. Nietzsche





Reply via email to