Discussion:
URL redirecting with APP
(too old to reply)
Igor Tandetnik
2009-08-15 01:03:25 UTC
Permalink
I saw some earlier posts regarding URL redirecting and it was
mentioned that we can redirect urls using
pSink->ReportResult(INET_E_REDIRECT_FAILED, 0,L"http://
www.google.com");
I addding this in start function
STDMETHODIMP Start(
/* [in] */ LPCWSTR szUrl,
/* [in] */ IInternetProtocolSink *pOIProtSink,
/* [in] */ IInternetBindInfo *pOIBindInfo,
/* [in] */ DWORD grfPI,
/* [in] */ HANDLE_PTR dwReserved)
{
pSink->ReportResult(INET_E_REDIRECT_FAILED, 0,L"http://
www.google.com");
return S_OK;
}
When I did this , Start function gets called infinitely by URLMON.
What did you expect? You claim to implement HTTP protocol. You are
redirecting to a URL that uses HTTP protocol. Of course you are going to
be called right back with the URL you've just redirected to.
AFAIK redirect kill the current navigation , so is this wrong?
Redirect kills the current navigation, and starts the new one, which
creates a new instance of your APP and calls Start on 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
spidy
2009-08-15 08:54:26 UTC
Permalink
Post by Igor Tandetnik
I saw some earlier posts regarding URL redirecting and it was
mentioned that we can redirect urls using
pSink->ReportResult(INET_E_REDIRECT_FAILED, 0,L"http://
www.google.com");
I addding this in start function
STDMETHODIMP Start(
/* [in] */ LPCWSTR szUrl,
/* [in] */ IInternetProtocolSink *pOIProtSink,
/* [in] */ IInternetBindInfo *pOIBindInfo,
/* [in] */ DWORD grfPI,
/* [in] */ HANDLE_PTR dwReserved)
{
pSink->ReportResult(INET_E_REDIRECT_FAILED, 0,L"http://
www.google.com");
return S_OK;
}
When I did this , Start function gets called infinitely by URLMON.
What did you expect? You claim to implement HTTP protocol. You are
redirecting to a URL that uses HTTP protocol. Of course you are going to
be called right back with the URL you've just redirected to.
AFAIK redirect kill the current navigation , so is this wrong?
Redirect kills the current navigation, and starts the new one, which
creates a new instance of your APP and calls Start on 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
So is there any way that redirection can be done without APP getting
called again?
Igor Tandetnik
2009-08-15 12:38:26 UTC
Permalink
Post by spidy
So is there any way that redirection can be done without APP getting
called again?
If you don't want to handle a particular URL, return
INET_E_USE_DEFAULT_PROTOCOLHANDLER from Start.
--
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
Loading...