Quote:Original post by blaze02
What can I write inside of the main() that will pop-up a webpage in an external browser?
So I need to create a thread running the default browser and open up a certain webpage... I've tried
system("http://www.blah.com")
I thought this would work. It spawns and quickly closes a DOS box. The system function should tell the OS to open that webpage, and that should spawn the default browser... is that not right?
No. system() simply sends a command to the OS directly, assuming it has a facility for understanding text commands (good luck on Mac OS pre OS X, for example), and the URL itself is not a command:
C:\Documents and Settings\some body>http://www.blah.com'http:' is not recognized as an internal or external command,operable program or batch file.
As noted,
start http://www.blah.com should work. 'start' is a program with a bit of intelligence to it; it reads its command line arguments, and can recognize (for example) URLs as bits of data that it should handle by launching the system's default web browser and pointing it at that URL.
But seriously, if this sort of thing is the primary purpose of your "program", you *don't* want to do it in C++. Use the right tool for the job: a script language like .bat (or even Python or Perl).