|
|
|
date: Tue, 20 May 2008 04:16:16 -0700 (PDT),
group: microsoft.public.inetsdk.programming.urlmonikers
back
Re: How to get page wise results using PassthruAPP
On May 21, 5:30 pm, "Igor Tandetnik" wrote:
> wrote in message
>
> news:3119f825-eb16-4173-8dc5-ece7bde7574a@h1g2000prh.googlegroups.com
>
>
>
>
>
> > On May 20, 4:57 pm, "Igor Tandetnik" wrote:
> >> wrote in message
>
> >>news:c73b95a0-a31e-4a7d-8072-8694080addfa@l17g2000pri.googlegroups.com
>
> >>> I am using PassthruAPP in integration with IE & it works fine.
> >>> I am outputting the results in a separate file.
>
> >>> But when I open multiple windows in IE using "open in new window"
> >>> all the results (http request/response) from multiple windows gets
> >>> mixed together.
>
> >>> So, is there any way to distinguish which http request/response
> >>> belongs to which page ?
>
> >>http://groups.google.com/group/microsoft.public.inetsdk.programming.w...> > I have tried using IWindowForBindingUI : GetWindow() method in
> > CTestSink: OnResponse method -- to get the window handle.
>
> You have to use Switch/Continue trick to have this work reliably, as
> discussed further in that thread.
> --
> 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- Hide quoted text -
>
> - Show quoted text -
Hello Igor,
I understand that
1. I need to call the Switch() method of IInternetProtocolSink
Interface from within the OnResponse method.
2. Then Automatically Urlmoniker would call the
IInternetProtocolRoot : Continue() method in the main UI thread.
3. I should call IWindowForBindUI : GetWindow() method from within
the IInternetProtocolRoot:Continue() method
Please correct me if any of the above is wrong.
Now mu query is :--
1. From Where & How do I get the Pointer to IInternetProtocolSink
Interface for calling its Switch() method ??
2. Should I place the call to "IWindowForBindUI : GetWindow() method
" that is in the ProtocolImpl.inl file OR override it in the
TestAPP.cpp as we have done for OnResponse , OnBeginningtransaction()
methods.
Please help -- Sample Code would be appreciated and very helpful.
Thanks & Awaiting Your Reply,
Hitesh
date: Wed, 21 May 2008 09:59:46 -0700 (PDT)
author: unknown
Re: How to get page wise results using PassthruAPP
On May 21, 10:21 pm, "Igor Tandetnik" wrote:
> genius1...@yahoo.co.in wrote:
> > 1. From Where & How do I get the Pointer to IInternetProtocolSink
> > Interface for calling its Switch() method ??
>
> One is passed to Start. If you are using CustomSinkPolicy from my tookit
> and provide your own sink object, then a) IInternetProtocolSink pointer
> is cached as m_spInternetProtocolSink member of sink object, and b) the
> protocol can get the pointer to your sink class by calling GetSink
> method.
>
> If you are not using CustomSinkPolicy, then you can simply cache the
> pointer yourself in Start.
>
> > 2. Should I place the call to "IWindowForBindUI : GetWindow() method
> > " that is in the ProtocolImpl.inl file OR override it in the
> > TestAPP.cpp as we have done for OnResponse , OnBeginningtransaction()
> > methods.
>
> You should call 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
Hello Igor,
I have called the switch() from OnResponse method.It works fine.
Then call goes to the below mentioned Continue function in
ProtocolImpl.inl file.
inline STDMETHODIMP IInternetProtocolImpl::Continue(
/* [in] */ PROTOCOLDATA *pProtocolData)
I changed the code for continue() function in ProtocolImpl.inl file in
the following manner :---
inline STDMETHODIMP IInternetProtocolImpl::Continue(
/* [in] */ PROTOCOLDATA *pProtocolData)
{
ATLASSERT(m_spInternetProtocol != 0);
HRESULT hr = m_spInternetProtocol ? m_spInternetProtocol-
>Continue(pProtocolData) : E_UNEXPECTED;
REFGUID rguidReason = IID_IHttpSecurity;
HWND phwnd = NULL;
CComPtr<IWindowForBindingUI> spWindowForBindingUI;
QueryServiceFromClient(&spWindowForBindingUI);
hr = spWindowForBindingUI ? spWindowForBindingUI-
>GetWindow(rguidReason,&phwnd) : S_OK;
return hr;
}
But this gives me the error ---> error C3861:
'QueryServiceFromClient': identifier not found.
Am I doing something wrong ???
How do I solve this problem --- Please guide me !!
Thanks & Awaiting your reply,
Hitesh
date: Sun, 25 May 2008 01:02:10 -0700 (PDT)
author: unknown
Re: How to get page wise results using PassthruAPP
On May 25, 5:42 pm, "Igor Tandetnik" wrote:
> wrote in message
>
> news:912ff581-6be3-48c2-a5f0-87369bcb1312@y22g2000prd.googlegroups.com
>
> > I have called the switch() from OnResponse method.It works fine.
> > Then call goes to the below mentioned Continue function in
> > ProtocolImpl.inl file.
>
> > inline STDMETHODIMP IInternetProtocolImpl::Continue(
> > /* [in] */ PROTOCOLDATA *pProtocolData)
>
> > I changed the code for continue() function in ProtocolImpl.inl file
>
> Why? Simply override it in your protocol class. It's virtual.
>
> > But this gives me the error ---> error C3861:
> > 'QueryServiceFromClient': identifier not found.
>
> This is a method of the sink class, not the protocol. It's very simple -
> see how it's implemented, copy/paste the code. It's just a couple of
> lines.
> --
> 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
Hello Igor,
I understand that I need to override it. But I am totally confused
about how to do it.
I tried overiding it using following ways but always landed with an
error.
1. class CTestSink :
public PassthroughAPP::CInternetProtocolSinkWithSP<CTestSink>,
public IHttpNegotiate,
public IInternetProtocol
2. class CTestSink :
public PassthroughAPP::CInternetProtocolSinkWithSP<CTestSink>,
public IHttpNegotiate,
public IInternetProtocolRoot
3. class CTestSink :
public PassthroughAPP::CInternetProtocolSinkWithSP<CTestSink>,
public IHttpNegotiate,
public IInternetProtocolImpl
4. class CTestSink :
public PassthroughAPP::CInternetProtocolSinkWithSP<CTestSink>,
public IHttpNegotiate,
public PassthroughAPP::CInternetProtocolImpl
I am confused about how to override it !!!
One more thing -----
Below is the code for continue() . Is it OK ?
STDMETHODIMP CTestSink::Continue()
{
USES_CONVERSION;
ATLASSERT(m_spInternetProtocol != 0);
HRESULT hr = m_spInternetProtocol ? m_spInternetProtocol-
>Continue(pProtocolData) : S_OK;
REFGUID rguidReason = IID_IHttpSecurity;
HWND phwnd = NULL;
CComPtr<IWindowForBindingUI> spWindowForBindingUI;
QueryServiceFromClient(&spWindowForBindingUI);
HRESULT hr = spWindowForBindingUI ?
spWindowForBindingUI->GetWindow(rguidReason,&phwnd) : S_OK;
return hr;
}
Please let me know how to override it &&
Whether above Continue() function is right for the overriding
implementation ???
Thanks & Awaiting your reply,
Hitesh
date: Sun, 25 May 2008 08:15:15 -0700 (PDT)
author: unknown
Re: How to get page wise results using PassthruAPP
wrote in message
news:f02a0a70-4c9d-4036-b66a-534855c99ca0@v26g2000prm.googlegroups.com
> On May 25, 5:42 pm, "Igor Tandetnik" wrote:
>> wrote in message
>>
>> news:912ff581-6be3-48c2-a5f0-87369bcb1312@y22g2000prd.googlegroups.com
>>> I changed the code for continue() function in ProtocolImpl.inl file
>>
>> Why? Simply override it in your protocol class. It's virtual.
>>
> I understand that I need to override it. But I am totally confused
> about how to do it.
>
> I tried overiding it using following ways but always landed with an
> error.
>
> 1. class CTestSink :
Continue is a method on the protocol, not the sink. It goes into
CTestAPP (which already derives from IInternetProtocolImpl, of course).
> Below is the code for continue() . Is it OK ?
>
> STDMETHODIMP CTestSink::Continue()
Again, it should go on CTestAPP
> QueryServiceFromClient(&spWindowForBindingUI);
From inside CTestAPP, you won't be able to call QueryServiceFromClient.
It's a very simple helper method. Just copy and paste its code. Or else,
have CTestAPP::Continue call some method you define on CTestSink - it's
probably more convenient to get to various pieces needed from there.
--
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
date: Mon, 26 May 2008 09:57:43 -0400
author: Igor Tandetnik
Re: How to get page wise results using PassthruAPP
On May 26, 6:57 pm, "Igor Tandetnik" wrote:
> wrote in message
>
> news:f02a0a70-4c9d-4036-b66a-534855c99ca0@v26g2000prm.googlegroups.com
>
> > On May 25, 5:42 pm, "Igor Tandetnik" wrote:
> >> wrote in message
>
> >>news:912ff581-6be3-48c2-a5f0-87369bcb1312@y22g2000prd.googlegroups.com
> >>> I changed the code for continue() function in ProtocolImpl.inl file
>
> >> Why? Simply override it in your protocol class. It's virtual.
>
> > I understand that I need to override it. But I am totally confused
> > about how to do it.
>
> > I tried overiding it using following ways but always landed with an
> > error.
>
> > 1. class CTestSink :
>
> Continue is a method on the protocol, not the sink. It goes into
> CTestAPP (which already derives from IInternetProtocolImpl, of course).
>
> > Below is the code for continue() . Is it OK ?
>
> > STDMETHODIMP CTestSink::Continue()
>
> Again, it should go on CTestAPP
>
> > QueryServiceFromClient(&spWindowForBindingUI);
>
> From inside CTestAPP, you won't be able to call QueryServiceFromClient.
> It's a very simple helper method. Just copy and paste its code. Or else,
> have CTestAPP::Continue call some method you define on CTestSink - it's
> probably more convenient to get to various pieces needed from there.
> --
> 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
Hello Igor,
Thanks for your explanation, but before I implement the same I have
one query.
1. By calling Switch() method in OnResponse() method , it should call
Continue() method on the main thread.
To test this I called GetCurrentThreadId() method from
within the Continue() method. But to my surprise-- it gave me
different thread id's.
Am I testing it wrongly ??
Would using the GetWindow() method would give the same thread ID ??
By the way , I have an older version of Passthruapp (the one that has
typedef
PassthroughAPP::CustomSinkStartPolicy<CTestSink>TestStartPolicy; &
not <CTestAPP,CTestSink> ). This version donot have GetSink() method.
Is PassthruAPPBeta.zip is the new version ?? OR there is some other
version which I am unaware of ??
date: Tue, 27 May 2008 02:04:16 -0700 (PDT)
author: unknown
Re: How to get page wise results using PassthruAPP
wrote in message
news:e17c02a1-8406-4f4c-9d5c-9dea4897058c@i36g2000prf.googlegroups.com
> 1. By calling Switch() method in OnResponse() method , it should call
> Continue() method on the main thread.
> To test this I called GetCurrentThreadId() method from
> within the Continue() method. But to my surprise-- it gave me
> different thread id's.
Different than what? Did you pass PD_FORCE_SWITCH flag to Switch?
> Would using the GetWindow() method would give the same thread ID ??
I don't understand. How does GetWindow give you a thread ID?
> By the way , I have an older version of Passthruapp (the one that has
> typedef
> PassthroughAPP::CustomSinkStartPolicy<CTestSink>TestStartPolicy; &
> not <CTestAPP,CTestSink> ). This version donot have GetSink() method.
In this version, the sink object is simply a member variable of the
protocol object, named m_sink if I recall correctly.
> Is PassthruAPPBeta.zip is the new version ??
Yes.
--
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
date: Tue, 27 May 2008 07:45:59 -0400
author: Igor Tandetnik
Re: How to get page wise results using PassthruAPP
On May 27, 4:45 pm, "Igor Tandetnik" wrote:
> wrote in message
>
> news:e17c02a1-8406-4f4c-9d5c-9dea4897058c@i36g2000prf.googlegroups.com
>
> > 1. By calling Switch() method in OnResponse() method , it should call
> > Continue() method on the main thread.
> > To test this I called GetCurrentThreadId() method from
> > within the Continue() method. But to my surprise-- it gave me
> > different thread id's.
>
> Different than what? Did you pass PD_FORCE_SWITCH flag to Switch?
>
> > Would using the GetWindow() method would give the same thread ID ??
>
> I don't understand. How does GetWindow give you a thread ID?
>
> > By the way , I have an older version of Passthruapp (the one that has
> > typedef
> > PassthroughAPP::CustomSinkStartPolicy<CTestSink>TestStartPolicy; &
> > not <CTestAPP,CTestSink> ). This version donot have GetSink() method.> In this version, the sink object is simply a member variable of the
> protocol object, named m_sink if I recall correctly.
>
> > Is PassthruAPPBeta.zip is the new version ??
>
> Yes.
> --
> 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
Hello Igor,
Different thread id means -->
1. I navigate to a web page say, www.xyz.com
2. I have already set PD_FORCE_SWITCH flag & then called Switch() in
OnResponse method.
3. Then control would go to Continue() method where I am noting down
the current thread ID using the GetCurrrentThreadId().
4. I am printing these thread id's into a file from this Continue()
function.
5. After navigating the page , I read the file for getting the thread
id's & I find different thread id's for a single web page.
I think I am doing something wrong, but unable to figure it out.
Thanks & Regards
Hitesh.
date: Tue, 27 May 2008 05:05:53 -0700 (PDT)
author: unknown
|
|