Is it bad idea to have static CComPtr member variables in an application.
Since we cannt control destruction of static variable and it can happen after CoUninitialze .
Is it bad idea to have static CComPtr member variables in an application. Since
Share
Provided you take the appropriate precautions, then using a
CComPtras a static member is not inherently evil.By “appropriate precautions”, I mean you should consider:
before usage;
CComPtr::Releaseis called in your class’ ownFinalReleasemethod when the instance count reaches zero.