Hi everyone,
Is there any way to open a website in the default browser that will be cross-platform?

Right now I'm using:

#include <windows.h>

ShellExecute(NULL, "open", "http://sourceforge.net/projects/tro", NULL, NULL, SW_SHOWNORMAL);

But this Windows only of course.


Thanks,
Brett

>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.

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).

Thanks for the help!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.