title: Is it safe to use C++ "operator new" rather than CoCreateinstance to create a COM object?
body: <p>this is probably a noob COM question, but googling this raises more questions than providing answers:</p>
  
  <p>Is it safe to use "operator new" instead of CoCreateInstance for a local COM instance?</p>
  
  <p>What I've done:</p>
  
  <ol>
  <li><p>I implemented the IOperationsProgressDialog interface
  <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb775368(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/bb775368(v=vs.85).aspx</a>
  by using public inheritence and thereby also implemented the IUnknown interface.</p></li>
  <li><p>I created an instance via "new RecyclerProgressCallback" and put it into a COM-Ptr for life-time management. "RecyclerProgressCallback" is the name of my derived class.</p></li>
  <li><p>I'm using this instance in IFileOperation::SetProgressDialog
  <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb775803(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/bb775803(v=vs.85).aspx</a></p></li>
  </ol>
  
  <p>Summary: My approach "seems" to work, but I don't trust it, there's just too much disconcerting information around COM object creation to rely on the observable behavior only.</p>
  
  <p>Are there any subtle risks, fallacies or other problems? Thanks!</p>