Hello everyone,
This is what mentioned in the book, ATL Internals about why Release function of CComPtr and CComQIPtr is needed for global and static variable.
--------------------
The destructor for global and static variable only executes after the main function exits, long after CoUninitialize runs, (That is, if it runs at all. You must link with the C++ runtime library for the constructors and destructors of global and static variable to run.) ATL itself doesn't use the C/C++ runtime library; thus, by default, ATL components don't link with the library.
--------------------
I do not quite understand what means "must link with the C++ runtime library for the constructors and destructors ... to run"? Could anyone help please?
thanks in advance,
George