I am hosting the web browser control in my own window. Here are the pertinent steps:
CoGetClassObject(CLSID_WebBrowser,
CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
NULL, IID_IClassFactory, (void **)&pClassFactory);
pClassFactory->CreateInstance(0, IID_IOleObject, (void **)&pObject);
pClassFactory->Release();
pObject->SetClientSite((IOleClientSite *)impl)
OleSetContainedObject((struct IUnknown *)pObject, true)
pObject->DoVerb(OLEIVERB_SHOW, NULL, (IOleClientSite *)impl, 0, hHpsWnd, &rect);
pWB->put_Visible(VARIANT_FALSE);
hr=pWB->Quit();
At the last statement above the hr return value is E_FAIL
. The end result of this failure in my code is leaking of a bunch of resources. What am I doing incorrectly?