In part 4 of ATL removal, I talked about removing CComPtr and replacing it with _com_ptr_t. You may run into some smart pointers in the form of CComQIPtr. CComPtr and CComQIPtr have the same base class and CComQIPtr is a super set of CComPtr. I tried to read up on CComQIPtr in MSDN, but the documentation wasn’t really very helpful. In the code I am working on, CComQIPtr is used to create a smart pointer and then do a QueryInterface hence the QI. I verified this is what goes on by looking through the atlbase.h header file from the SDK.
If you don’t want to depend on ATL in the sense that your binary doesn't load the ATL dlls, the it is fine to still include the .h file, but if you want to purge ATL altogether, read on. Keep in mind _com_ptr_t doesn't do everything that ATL smart pointers, so some extra manual work may still be required. This is an example of a case where the extra legwork is required.
if (lp != NULL)
lp->QueryInterface(*piid, (void **)&p);
Before I had some code that looked like this:
To fix it, I changed it to this:
_com_ptr_t<_com_IIID< IYourInterface, &__uuidof(IYourInterface)> > spLocaclVariable;
spMemberProperty ->QueryInterface(__uuidof(IYourInterface), (void**)& spLocaclVariable);
I think this should do the trick for your CComQIPtr smart pointers.