Cross Platform Way to Open Websites

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2008
Posts: 2
Reputation: Bretzel13 is an unknown quantity at this point 
Solved Threads: 0
Bretzel13 Bretzel13 is offline Offline
Newbie Poster

Cross Platform Way to Open Websites

 
0
  #1
Mar 11th, 2009
Hi everyone,
Is there any way to open a website in the default browser that will be cross-platform?

Right now I'm using:
  1. #include <windows.h>
  2.  
  3. ShellExecute(NULL, "open", "http://sourceforge.net/projects/tro", NULL, NULL, SW_SHOWNORMAL);

But this Windows only of course.


Thanks,
Brett
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Cross Platform Way to Open Websites

 
1
  #2
Mar 11th, 2009
>Is there any way to open a website in the default browser that will be cross-platform?
Who defines what the 'default' browser is defined as? Sure, on Windows it's some registry entry, but on other operating systems there often is no default browser.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 794
Reputation: siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of 
Solved Threads: 135
siddhant3s's Avatar
siddhant3s siddhant3s is offline Offline
Master Poster

Re: Cross Platform Way to Open Websites

 
0
  #3
Mar 11th, 2009
Hmm,
Look: I use Linux, and I have firefox in it as my favorite browser. Every time I need to open a URL, I call $ firefox URL So, if you are saying cross-platform, your problem is merely to open a file in some application.
What I suggest is, you can try conditional compiling in this case.
This will make your code portable to a great extend( but not complete portable).
Siddhant Sanyam
(Not posting much)
My Blog: Yatantrika
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 2
Reputation: Bretzel13 is an unknown quantity at this point 
Solved Threads: 0
Bretzel13 Bretzel13 is offline Offline
Newbie Poster

Re: Cross Platform Way to Open Websites

 
0
  #4
Mar 11th, 2009
Thanks for the help!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC