Alter querystring through APP
- From: "Max K." <maxkl@xxxxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 07:34:51 -0700
While using Igor's Passthru APP I need to add a querystring to a
requested url.
In my Start() method I am appending the querystring to szUrl
parameter and calling target app's Start() method with the new URL
with querystring. The request gets sent with the new url.
STDMETHODIMP CTestAPP::Start(
LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
{
LPCWSTR szUrlQuery = szUrl + querystring //add querystring to url
targetApp -> Start(szUrlQuery, ...) //call target app's start with new
url
}
In my ReportData() method my App calls targetSink's ReportProgress
method with BINDSTATUS_REDIRECTING flag with the new URL (szUrlQuery)
to notify the request URL had been changed.
STDMETHODIMP CTestSink::ReportData(
/* [in] */ DWORD grfBSCF,
/* [in] */ ULONG ulProgress,
/* [in] */ ULONG ulProgressMax)
{
m_spInternetProtocolSink->ReportProgress(BINDSTATUS_REDIRECTING,
szUrlQuery); //notify redirect with new URL with querystring
m_spInternetProtocolSink->ReportData((BSCF_FIRSTDATANOTIFICATION |
BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), dwLegth,
dwLegth); //notify target sink of data
hr = m_spInternetProtocolSink->ReportResult(S_OK, S_OK, NULL);
}
I tested by typing URL without querystring in the address bar and saw
how APP added the querystring and sent correct request. I receive
the correct form and the browser address bar displays the new URL with
the querystring.
However, when I submit the form, that is suppose to request the same
URL+ querystring, the browser sends to APP a request without the
querystring. Why does this happen?
If I ignore this problem and have my APP add the querystring to the
URL on the second request, then the page will appear in browser in
exactly the same way as before. However when I submit the form again
(3-request) , the browser doesn't send the request (and app doesn't
start) and gives "The webpage cannot be displayed" message. Also the
browser address bar shows some gibberish. Does anybody know what I am
doing wrong?
.
- Follow-Ups:
- Re: Alter querystring through APP
- From: Igor Tandetnik
- Re: Alter querystring through APP
- Prev by Date: async protocol: IFRAME access denied
- Next by Date: Re: Alter querystring through APP
- Previous by thread: async protocol: IFRAME access denied
- Next by thread: Re: Alter querystring through APP
- Index(es):
Relevant Pages
|
Loading