I did use CComPtr, but they only reduce the amount of footguns, they don&#x27;t get rid of them. In my case, I accidentally stored a reference to the inner pointer instead of calling Detach.<p>My point isn&#x27;t that there aren&#x27;t nice idiomatic ways of writing nice windows&#x2F;c++ code that are not fragile, it&#x27;s that unless you&#x27;re well versed in them, you can easily screw things up pretty badly.<p>[EDIT]: In case it&#x27;s not clear, I am not a windows C++ developer, I&#x27;ve read a decent amount of windows C++ code, so I sort of know what&#x27;s going on, but I&#x27;ve written less than 5k lines of windows C&#x2F;C++ in my life.