Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 5th, 2007, 11:14 AM   #1
Edgar
Programmer
 
Edgar's Avatar
 
Join Date: May 2006
Location: Bathroom
Posts: 43
Rep Power: 0 Edgar is on a distinguished road
How can I open ie w c++

Hi, I have a question , How can I open ie w c++?
I'm trying to open the internet explorer w c++, I know how to do it, but, how can I open ie w the addres that I want(yahoo, cox, or whatever).
Edgar is offline   Reply With Quote
Old Jan 5th, 2007, 11:42 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
One way. Note that the extra quotes are required because of spaces in directory names.
#include <iostream>
#include <string>

using std::cin;
using std::cout;
using std::endl;
using std::string;

int main ()
{
	string prog = "\"E:\\Program Files\\Internet Explorer\\iexplore.exe\"";
	string site = "http:\\\\www.yahoo.com";
	string cmd = prog + " " + site;
	system (cmd.c_str ());

	return 0;
}
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 9th, 2007, 12:06 PM   #3
Edgar
Programmer
 
Edgar's Avatar
 
Join Date: May 2006
Location: Bathroom
Posts: 43
Rep Power: 0 Edgar is on a distinguished road
Thanks DaWei, you are the man. Do you know any book or web page to learn all this staff?
Edgar is offline   Reply With Quote
Old Jan 9th, 2007, 1:39 PM   #4
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Thinking in C++
http://www.mindview.net/Books/TICPP/...ngInCPP2e.html
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Jan 11th, 2007, 3:55 AM   #5
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
google "system C++" (not in quotes) and check MSDN or some such site to reference the other crap.

i added some comments, might be wrong. note he is escaping the '\' character so that's why there's extra backslashes.

int main ()
{
        //the absolute path to where internet explorer is on your computer
	string prog = "\"E:\\Program Files\\Internet Explorer\\iexplore.exe\"";
	//the site you want to start up with
        string site = "http:\\\\www.yahoo.com";
	//concatenating those variables for SYSTEM()
        string cmd = prog + " " + site;
        //(i believe) converting the previous concatenation into a c-string
        //(array-based string) within the call to SYSTEM()
        //this could be done in two steps to simplify...
        //first convert to c-string, then make the call with the new variable
	system (cmd.c_str ());

	return 0;
}
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Old Jan 11th, 2007, 12:32 PM   #6
Edgar
Programmer
 
Edgar's Avatar
 
Join Date: May 2006
Location: Bathroom
Posts: 43
Rep Power: 0 Edgar is on a distinguished road
Thanks
Edgar is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing a License for Open Source Project smith.norton Project Ideas 23 Oct 7th, 2006 4:27 AM
OnlineTextEditor.Com! Sane Show Off Your Open Source Projects 43 Jun 16th, 2006 9:55 AM
Help using this function Eric the Red Visual Basic 10 Feb 27th, 2006 11:26 AM
open a page and close it when it's done diamondback Visual Basic 1 Jan 28th, 2005 6:43 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:36 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC