Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

URL redirecting with APP

62 views
Skip to first unread message

spidy

unread,
Aug 14, 2009, 8:33:57 PM8/14/09
to
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.

AFAIK redirect kill the current navigation , so is this wrong?

What is the best place to put the redirect?

Igor Tandetnik

unread,
Aug 14, 2009, 9:03:25 PM8/14/09
to
spidy <alien...@gmail.com> wrote:
> 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

unread,
Aug 15, 2009, 4:54:26 AM8/15/09
to
On Aug 15, 6:03 am, "Igor Tandetnik" <itandet...@mvps.org> wrote:

So is there any way that redirection can be done without APP getting
called again?

Igor Tandetnik

unread,
Aug 15, 2009, 8:38:26 AM8/15/09
to
spidy wrote:
> 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.

0 new messages