|
|
|
date: Tue, 18 Mar 2008 18:29:01 -0700 (PDT),
group: microsoft.public.inetsdk.programming.urlmonikers
back
Re: permanently registering the PassthruAPP
On Mar 19, 11:28 pm, "Igor Tandetnik" wrote:
> genius1...@yahoo.co.in wrote:
> > I have already implemented a BHO which catches beforeNavigate &
> > DocumentComplete events.
> > But I want to catch each http request of IE.
>
> > How do I do that ?
>
> Didn't I just answer that? You have it register your passthrough APP.
>
> > Can you give me some more information about IInternetSession ?
>
> http://msdn2.microsoft.com/en-us/library/aa767757.aspx
>
> > If some sample code is available it would be more helpful.
>
> My PassthruAPP sample, which you have apparently already discovered,
> shows how to use it.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hi Igor,
Thanks for the Reply,
What I understood is that I will have to register the APP from within
the BHO.
Where should I register the APP.
Should I register in the event handler of BeforeNavigate Event ?? If
no, then where ?
One more question -- Do I need to make any changes in the
ProtocolCF.inl & Protocolimpl.inl files?
OR just include these files as it is in the BHO ?
Thanks & Awaiting your response,
Hitesh.
date: Thu, 20 Mar 2008 17:39:44 -0700 (PDT)
author: unknown
Re: permanently registering the PassthruAPP
On Mar 21, 5:51 am, "Igor Tandetnik" wrote:
> genius1...@yahoo.co.in wrote:
> > What I understood is that I will have to register the APP from within> > the BHO.
> > Where should I register the APP.
> > Should I register in the event handler of BeforeNavigate Event ?? If
> > no, then where ?
>
> IObjectWithSite::SetSite implementation is probably most convenient. You
> only need to do it once per process, not for every page or anything.
>
> > One more question -- Do I need to make any changes in the
> > ProtocolCF.inl & Protocolimpl.inl files?
>
> In general, no. Unless you find a bug or suggest an improvement, of
> course. They are designed to be used as is.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hi Igor,
I have registered the PassthruAPP in SetSite function of BHO using
RegisterNamespace function for http & https.
Also i have included the ProtocolCF.inl, ProtocolImpl.inl files.
But when i run it the control never goes to BeginningTransaction
method.
I donot know why?
Is there anything else to do in the registration process ?
What I have done is -- just included the RegisteNamespace function in
the code.
any help/suggestion is appreciated.
Thanks & awaiting your reply,
Hitesh
date: Sat, 22 Mar 2008 08:59:02 -0700 (PDT)
author: unknown
Re: permanently registering the PassthruAPP
On Mar 23, 12:41 am, "Igor Tandetnik" wrote:
> wrote in message
>
> news:e4ec5e9e-aaaf-4b2b-b293-100c3f09701e@s8g2000prg.googlegroups.com
>
> > I have registered the PassthruAPP in SetSite function of BHO using
> > RegisterNamespace function for http & https.
> > Also i have included the ProtocolCF.inl, ProtocolImpl.inl files.
>
> > But when i run it the control never goes to BeginningTransaction
> > method.
> > I donot know why?
>
> I don't know either. I seem to have misplaced my trusty crystal ball,
> and my mind-reading is not as sharp these days as it used to be.
>
> > Is there anything else to do in the registration process ?
>
> That depends on what you have already done.
>
> > What I have done is -- just included the RegisteNamespace function in
> > the code.
>
> What do you mean, "just included"? Have you actually called it? If so,
> show how.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hi Igor,
RegisterNamespace function is called in the setSite function of BHO.
The control then passes to ProtocolCF.inl file.
But through out the execution of the program the control never goes to
ProtocolImpl.inl file.
What could be the solution for this ??
Thanks & Awaiting your reply,
Hitesh
date: Sun, 23 Mar 2008 18:39:21 -0700 (PDT)
author: unknown
Re: permanently registering the PassthruAPP
On Mar 23, 12:41 am, "Igor Tandetnik" wrote:
> wrote in message
>
> news:e4ec5e9e-aaaf-4b2b-b293-100c3f09701e@s8g2000prg.googlegroups.com
>
> > I have registered the PassthruAPP in SetSite function of BHO using
> > RegisterNamespace function for http & https.
> > Also i have included the ProtocolCF.inl, ProtocolImpl.inl files.
>
> > But when i run it the control never goes to BeginningTransaction
> > method.
> > I donot know why?
>
> I don't know either. I seem to have misplaced my trusty crystal ball,
> and my mind-reading is not as sharp these days as it used to be.
>
> > Is there anything else to do in the registration process ?
>
> That depends on what you have already done.
>
> > What I have done is -- just included the RegisteNamespace function in
> > the code.
>
> What do you mean, "just included"? Have you actually called it? If so,
> show how.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hi Igor,
Given below here is the code for SetSite function of my BHO, where i
have called RegisterNameSpace()
STDMETHODIMP CHelloWorldBHO::SetSite(IUnknown* pUnkSite)
{
if (pUnkSite != NULL)
{
CComPtr<IInternetSession> spSession;
CoInternetGetSession(0, &spSession, 0);
MetaFactory::CreateInstance(CLSID_HttpProtocol, &m_spCFHTTP);
spSession->RegisterNameSpace(m_spCFHTTP, CLSID_NULL, L"http", 0, 0,
0);
MetaFactory::CreateInstance(CLSID_HttpSProtocol, &m_spCFHTTPS);
spSession->RegisterNameSpace(m_spCFHTTPS, CLSID_NULL, L"https", 0,
0, 0);
// Retrieve and store the IWebBrowser2 pointer
m_spWebBrowser2 = pUnkSite;
if (m_spWebBrowser2 == NULL)
return E_INVALIDARG;
// Retrieve and store the IConnectionPointerContainer pointer
m_spCPC = m_spWebBrowser2;
if (m_spCPC == NULL)
return E_POINTER;
// Connect to the container for receiving event notifications
return Connect();
}
else
{
// Release cached pointers and other resources here.
m_spWebBrowser2.Release();
m_spCPC.Release();
}
}
The code can be built successfully & it also executes but control
never passes through Protocolimpl.inl file & Beginning Transaction
method.
Any help/suggestion is appreciated.
Thanks & awaiting your reply,
Hitesh.
date: Sun, 23 Mar 2008 18:49:17 -0700 (PDT)
author: unknown
Re: permanently registering the PassthruAPP
On Mar 23, 12:41 am, "Igor Tandetnik" wrote:
> wrote in message
>
> news:e4ec5e9e-aaaf-4b2b-b293-100c3f09701e@s8g2000prg.googlegroups.com
>
> > I have registered the PassthruAPP in SetSite function of BHO using
> > RegisterNamespace function for http & https.
> > Also i have included the ProtocolCF.inl, ProtocolImpl.inl files.
>
> > But when i run it the control never goes to BeginningTransaction
> > method.
> > I donot know why?
>
> I don't know either. I seem to have misplaced my trusty crystal ball,
> and my mind-reading is not as sharp these days as it used to be.
>
> > Is there anything else to do in the registration process ?
>
> That depends on what you have already done.
>
> > What I have done is -- just included the RegisteNamespace function in
> > the code.
>
> What do you mean, "just included"? Have you actually called it? If so,
> show how.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Hi Igor,
Given below here is the code for SetSite function of my BHO, where i
have called RegisterNameSpace()
STDMETHODIMP CHelloWorldBHO::SetSite(IUnknown* pUnkSite)
{
if (pUnkSite != NULL)
{
CComPtr<IInternetSession> spSession;
CoInternetGetSession(0, &spSession, 0);
MetaFactory::CreateInstance(CLSID_HttpProtocol, &m_spCFHTTP);
spSession->RegisterNameSpace(m_spCFHTTP, CLSID_NULL, L"http", 0, 0,
0);
MetaFactory::CreateInstance(CLSID_HttpSProtocol, &m_spCFHTTPS);
spSession->RegisterNameSpace(m_spCFHTTPS, CLSID_NULL, L"https", 0,
0, 0);
// Retrieve and store the IWebBrowser2 pointer
m_spWebBrowser2 = pUnkSite;
if (m_spWebBrowser2 == NULL)
return E_INVALIDARG;
// Retrieve and store the IConnectionPointerContainer pointer
m_spCPC = m_spWebBrowser2;
if (m_spCPC == NULL)
return E_POINTER;
// Connect to the container for receiving event notifications
return Connect();
}
else
{
// Release cached pointers and other resources here.
m_spWebBrowser2.Release();
m_spCPC.Release();
}
}
The code can be built successfully & it also executes but control
never passes through Protocolimpl.inl file & Beginning Transaction
method.
Any help/suggestion is appreciated.
Thanks & awaiting your reply,
Hitesh.
date: Sun, 23 Mar 2008 18:49:48 -0700 (PDT)
author: unknown
|
|