global and static object

Joined
Feb 12, 2008
Messages
108
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top