Solved

How to launch a browser to browse a specific site.

Posted on 1998-08-16
4
244 Views
Last Modified: 2010-04-01
I have seen applications where you can click on a button or menu to launch your default internet browser to browse a specific webpage. How do I write Visual C++ code for do this, i.e. launching the browser?

(Yes, I admit I'm dumb - This should be pretty straighforward, but I've just started programming in VC++ barely a week ago...)
0
Comment
Question by:regina081698
  • 2
4 Comments
 
LVL 1

Expert Comment

by:arun_ta
ID: 1170441
Use the ::CreateProcess() function.Pass the URL as one of its arguments. Any doubt, check VC++ Help.
0
 

Author Comment

by:regina081698
ID: 1170442
arun_ta, thanks :-) But, I'm still confused (pardon my ignorance...) - How do I CreateProcess when I do NOT know the name of the executable module in advance? Could you please fill in the blanks below? (Hope this is not too much to ask?)

void CAboutDlg::OnLaunchBrowser()
{
      // TODO: Add your control notification handler code here
}


0
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1170443
::ShellExecute(NULL, _T("open"), _T("http://www.experts-exchange.com"), NULL, NULL, SW_SHOWNORMAL);

A more complete version can be found at http://www.wdj.com. Download the source code for August 1997 and look for gotourl.c inside patersn.zip.
0
 

Author Comment

by:regina081698
ID: 1170444
chensu, this works like magic. You're a darling!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question