|
-
April 15th, 1999, 01:10 AM
#1
Invoke IE from VC++
How I can load a HTML file from a Visual C++ program? I want to load that file into Internet Explorer. I have Visual C++ 5 Enterprise Version for Win95, Internet Explorer 3.0.
-
April 15th, 1999, 02:01 AM
#2
Re: Invoke IE from VC++
Try using ShellExecute:
CString sFile="c:\\my.html";// your html file path goes here
HINSTANCE h = ShellExecute(NULL, "open", sFile, NULL, NULL, SW_SHOWNORMAL);
I think that will work as long as IE is registered as the app for HTML files.
If not it would find whichever browser the user has made default.
-
April 15th, 1999, 02:21 AM
#3
Re: Invoke IE from VC++
simply add this command to your code:
ShellExecute(NULL,"open",URL,NULL,NULL,SW_SHOWNORMAL);
(where URL is a string containing the HTML URL or file name to load)
-
April 15th, 1999, 04:27 AM
#4
Re: Invoke IE from VC++
Thanks. I hope it will work.
Zulfi
-
April 26th, 1999, 04:55 AM
#5
Re: Invoke IE from VC++
You should also "insert a IE ActiveX control" in a dialog box of your VC++ applications.
Then "Add a member variable" on this control.
And then call the following code:
m_WebBrowser.Navigate( m_strURL, NULL, NULL, NULL, NULL);
where m_WebBrowser is the member variable of the IE ActiveX object and m_strURL is your URL.
-
May 11th, 1999, 12:45 PM
#6
Re: Invoke IE from VC++
On most systems (at least mine) the running ShellExecute with the URL as a parameter activates the most recently launched instance of IE and opens the URL in it. To open a NEW instance of IE, do this:
ShellExecute(AfxGetApp()->GetMainWnd()->m_hWnd, NULL, "C:\\Program Files\\Plus!\\Microsoft Internet\\IEXPLORE.EXE", "http://www.codeguru.com", NULL, SW_SHOWNORMAL);
This runs IE and sends the URL as a parameter. I assume something similar would work with Netscape.
__________________________________________
_=====_ Espen Zachrisen
========= Sloan School of Management
||||||||| MBA Class of 2000
========= Email: [email protected]
MIT Sloan Tel: (781) 767-0417
__________________________________________
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|