Jump to content
  • Advertisement
Sign in to follow this  
ratha

Problem opening URL

This topic is 2612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!
I'm trying to open a URL from a Dialog in MFC with the following code.

CWebBrowser2 m_WebBrowserCtrl.Navigate(URL.c_str(), NULL, NULL, NULL, NULL);


But it navigates to the URL at the computers where IE is installed. Otherwise it's not working. I've to read the default browser from Regsitry and open the URL with that browser. How to do this in MFC?

Share this post


Link to post
Share on other sites
Advertisement
I think CWebBrowser2is using IHTML, which requires IE installed.
[s]If you don't want to depend on IE, try some other library, such like Webkit or Gecko.
[/s](Please ignore it)[s] :rolleyes:
[/s]

Share this post


Link to post
Share on other sites

I think CWebBrowser2is using IHTML, which requires IE installed.
If you don't want to depend on IE, try some other library, such like Webkit or Gecko.

Will the above libraries work with the default browser(not any specific like IE or Chrome) that's installed in a System?

Share this post


Link to post
Share on other sites

Damn, forgot the very heavy libraries I said.

To open URL in default browser, try Win API ShellExecuteEx
I will do all your need.

Here is some example


I've already tried this. But I got the following error:

APPLICATION ERROR:

This error has occurred for one of the following reasons:


(i) You have kept the browser window idle for a long time. Your session has expired.
(ii) You have logged in from another browser window.
(iii) You are accessing the application URL from a saved or static page.

If I use,
CWebBrowser2::Navigate()
the same URL opens fine but not opening without IE. What else to do?

Share this post


Link to post
Share on other sites
Read your post on MSDN, another guy had answered you,

"So, the browser did open, and did navigate to the URL you asked it to navigate to. The server then responded with this page. Figure out why. ShellExecute did its job corretly."

Share this post


Link to post
Share on other sites

Read your post on MSDN, another guy had answered you,

"So, the browser did open, and did navigate to the URL you asked it to navigate to. The server then responded with this page. Figure out why. ShellExecute did its job corretly."


How to find out what's causing this error?

Share this post


Link to post
Share on other sites

[quote name='wqking' timestamp='1306477365' post='4816315']
Damn, forgot the very heavy libraries I said.

To open URL in default browser, try Win API ShellExecuteEx
I will do all your need.

Here is some example


I've already tried this. But I got the following error:

APPLICATION ERROR:

This error has occurred for one of the following reasons:


(i) You have kept the browser window idle for a long time. Your session has expired.
(ii) You have logged in from another browser window.
(iii) You are accessing the application URL from a saved or static page.

If I use,
CWebBrowser2::Navigate()
the same URL opens fine but not opening without IE. What else to do?
[/quote]

That error looks an awful lot like something the website is telling you, not your system at any level. I have a sneaking suspicion that whatever website you're trying to direct to has issues with browsers that are not Internet Explorer. Can you access the site fine without code? Simply going to the URL in your browser of choice that is not IE?

Share this post


Link to post
Share on other sites

[quote name='ratha' timestamp='1306477757' post='4816317']
[quote name='wqking' timestamp='1306477365' post='4816315']
Damn, forgot the very heavy libraries I said.

To open URL in default browser, try Win API ShellExecuteEx
I will do all your need.

Here is some example


I've already tried this. But I got the following error:

APPLICATION ERROR:

This error has occurred for one of the following reasons:


(i) You have kept the browser window idle for a long time. Your session has expired.
(ii) You have logged in from another browser window.
(iii) You are accessing the application URL from a saved or static page.

If I use,
CWebBrowser2::Navigate()
the same URL opens fine but not opening without IE. What else to do?
[/quote]

That error looks an awful lot like something the website is telling you, not your system at any level. I have a sneaking suspicion that whatever website you're trying to direct to has issues with browsers that are not Internet Explorer. Can you access the site fine without code? Simply going to the URL in your browser of choice that is not IE?
[/quote]

No. I can't access even with IE directly. It runs based on a session. How to open a URL that is based on a session with ShellExecute or is there any other way to open a URL that is based on a Session?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!