BOOL CShellBrowser2::_LoadBrowserHelperObjects(void)
{
BOOL bRet = FALSE;
HKEY hkey;
if (_pbbd->_pautoWB2 &&
RegOpenKey(HKEY_LOCAL_MACHINE, REGSTR_PATH_EXPLORER TEXT("\\Browser Helper Objects"), &hkey) == ERROR_SUCCESS)
{
TCHAR szGUID[64];
DWORD cb = ARRAYSIZE(szGUID);
for (int i = 0;
RegEnumKeyEx(hkey, i, szGUID, &cb, NULL, NULL, NULL, NULL) == ERROR_SUCCESS;
i++)
{
CLSID clsid;
IObjectWithSite *pows;
if (GUIDFromString(szGUID, &clsid) &&
SUCCEEDED(CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, IID_IObjectWithSite, (void **)&pows)))
{
pows->SetSite(_pbbd->_pautoWB2); // give the poinetr to IWebBrowser2
SA_BSTRGUID strClsid;
// now register this object so that it can be found through automation.
SHTCharToUnicode(szGUID, strClsid.wsz, ARRAYSIZE(strClsid.wsz));
strClsid.cb = lstrlenW(strClsid.wsz) * SIZEOF(WCHAR);