visual c++ - Static CComPtr Variable -
What is the static CComPtr member variable in an application? Since we can not control the destruction of stable variables and it can happen after CoUninitialze.
provided you take proper precautions, then using a CComPtr
As a member, it is not naturally bad.
By "proper caution", I mean you should consider:
- To make sure that using it Has been started earlier;
- Maintain a mute, static instance count for your own class;
- Making sure your class is called in your method when the example count becomes zero.
Comments
Post a Comment