spidy
2009-08-15 19:41:31 UTC
I created a BHO and implemented a protocol handler .
Now in BHO setSite method I am creating Protocol class factory and
then calling registernamespace in IInternetSession.
CComPtr<IClassFactory> m_spCF;
CComPtr<IInternetSession> spSession;
hr = CoInternetGetSession(0, &spSession, 0);
if (SUCCEEDED(hr))
{
m_spCF.CoCreateInstance(CLSID_ProtocolHandlerCF);
if(SUCCEEDED(hr))
{
hr = spSession->RegisterNameSpace(m_spCF, CLSID_NULL, L"http", 0,
0, 0);
}
}
This works fine but when I run it gives me error and IE exists.
Error is
---------------------------
Windows Internet Explorer
---------------------------
Internet Explorer cannot download fwlink/ from go.microsoft.com.
The application called an interface that was marshalled for a
different thread.
---------------------------
OK
---------------------------
AS per my understanding , BHO is launched by IE and APP is created by
BHO.
Both BHO and APP are in same dll. Is there any issue with this? Am I
doing something wrong..
Now in BHO setSite method I am creating Protocol class factory and
then calling registernamespace in IInternetSession.
CComPtr<IClassFactory> m_spCF;
CComPtr<IInternetSession> spSession;
hr = CoInternetGetSession(0, &spSession, 0);
if (SUCCEEDED(hr))
{
m_spCF.CoCreateInstance(CLSID_ProtocolHandlerCF);
if(SUCCEEDED(hr))
{
hr = spSession->RegisterNameSpace(m_spCF, CLSID_NULL, L"http", 0,
0, 0);
}
}
This works fine but when I run it gives me error and IE exists.
Error is
---------------------------
Windows Internet Explorer
---------------------------
Internet Explorer cannot download fwlink/ from go.microsoft.com.
The application called an interface that was marshalled for a
different thread.
---------------------------
OK
---------------------------
AS per my understanding , BHO is launched by IE and APP is created by
BHO.
Both BHO and APP are in same dll. Is there any issue with this? Am I
doing something wrong..