I was wondering if it is possible to open an internet browser window by calling a function in c++. If it is possible could you please post the code to do so.
Thank You Very Much!
I was wondering if it is possible to open an internet browser window by calling a function in c++. If it is possible could you please post the code to do so.
Thank You Very Much!
You can START another application by calling some function in your code, yes. But you need to know what the application is (e.g. firefox, internet explorer, opera or whatever else).
You can probably use "exec" or "system" to do this.
--
Mats
I want to open a specific webpage in Internet Explorer what is the most effective way to do that
Thanks!
The most efficient - that's a difficult question, as it depends on what you want to be efficient, the time it takes to load internet explorer will be much bigger factor than what you do in your program, if you are after performance.
If on the other hand you are asking "what's the shortest code I need to write to do that", thenis a pretty simple way to do it.Code:system("iexplore http://www.somesite.com/somepath/somepage.html");
--
Mats
that will do just fine
Thanks
c++ says thats not a valid command
That 'what' isn't a valid command? system? or something else?
if you're using the system function, I believe you need to #include <cstdlib> at the top of your program.
whatever you put between the double-quotes for the system function is entirely dependent on your system, your version of your O/S, etc. If your computer doesn't have internet explorer installed, then calling "iexplore ..." won't do anything. (Although some versions call it 'explorer' rather than 'iexplore')
in short - if you put something into system() that doesn't work when typed from the commandline on your computer, then you can pretty much guarantee that it won't work in your program either.
Last edited by Bench82; 08-14-2007 at 08:56 AM.
I put in this line
system("iexplore http://www.madigangames.com/default.aspx");
and I get this error at runtime (in the console window)
'iexplore' is not reconized as an internal or external command,
operable program or batch file.
Check the FAQ on how to run another program from within your program. There are other examples that might work better (I think ShellExecute might be best for you there). For example, you might be able to just run the web address and windows will automatically load it in the default browser.
Also, for this particular problem with system, what happens if you open a console window and type the same iexplore command?
Thanks
I could not find it in the FAQ
Thanks
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"
>> I could not find it in the FAQ
It is the one that says "Run a program from within a program."
Is their a system function that will open a webpage? Im not looking for anything complicated.
Thanks
What is wrong with the suggested solution?