Solved

How to launch a browser to browse a specific site.

Posted on 1998-08-16
4
238 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now