I'm trying to reuse your code in my app, but I don't know how to release resources properly:
// A simple IInArchive
NArchive::N7z::CHandler *temp = new NArchive::N7z::CHandler;
CMyComPtr<IInArchive> archive = (IInArchive *) temp;
// Any of these gives an access violation
How am I supposed to release all associated memory?
CMyComPtr also can release it in destructor, so in most cases you don't need to care about releasing.