Solved

How to launch the Webbrowser in VC++?

Posted on 1997-05-26
1
238 Views
Last Modified: 2008-03-06
Hi All,
   In vc++, I want to launch the default Webbrowser to open the file.
How can I do it?

Thanks!!
Ben
ben@bestinfo.net
0
Comment
Question by:jpchen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
jpk041897 earned 50 total points
ID: 1163703
Use Winexec());

WinExec("PATH\BROWSER.EXE File:///c:|path/file", SW_NORMAL");


Notes:

PATH is the full path to your browser.
BROWSER.EXE is the filename of the browswer executable.(Example Netscape.exe or MSIE.exe)

The File:///<drive>|path/file.html is URL syntax for a file in a local drive. (File:/// indicates that it is in a local drive) notice that the <drive>: is changed to <drive>|  (bar)and backslashes are changed to slashes.For example:

c:\MyPath\Myfile

is mapped as:

c|/MyPath/Myfole
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

628 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