Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web browser functions using CHtmlView 1

Status
Not open for further replies.

zulfi1234

Instructor
Jul 2, 2000
32
PK
I have created a HTML resource but I am not getting the web browser functions. Also how to modify OnInitialUpdate() so that its derived from CHtmlView.<br><br>Zulfi
 
Dear Zulfi,<br><br>Well to start, you can't derive from anything in OnIntialUpdate(). Actually you can't derive from any function since derivation is a C++ compile time feature not a runtime feature. <br><br>So either you need to brush up on your C++ or your question is confusing. <br><br>If you wanted your view class to be derived from CHtmlView you should have done that in the 'App Wizard' steps. It can be done manually by creating a new class derived from CHtmlView and replacing it with your original view in the document template constructor in your application class's InitInstance(). If that last sentence is confusing then you probably are not ready to try that method yet, so hopefully you just started the project and you can start over and select CHtmlView in the App Wizard step.<br><br>Hope this helps<br>-pete<br><br><br>
 
I want something like that <br>void CIEAppView::OnInitialUpdate()<br>{<br> CHtmlView::OnInitialUpdate();<br><br> // Load initial HTML content from resource.<br> //LoadFromResource(IDR_HTML1);(Please ignore it)<br>}<br><br>BOOL CIEAppView::preCreateWindow(CREATESTRUCT& cs)<br>{<br> // TODO: Modify the Window class or styles here by modifying<br> //&nbsp;&nbsp;the CREATESTRUCT cs<br><br> return CView::preCreateWindow(cs);<br>}<br><br>but I am getting <br><br>void CIEAppView::OnInitialUpdate()<br>{<br> CView::OnInitialUpdate();<br><br> // Load initial HTML content from resource.<br> LoadFromResource(IDR_HTML1);<br>}<br><br>BOOL CIEAppView::preCreateWindow(CREATESTRUCT& cs)<br>{<br> // TODO: Modify the Window class or styles here by modifying<br> //&nbsp;&nbsp;the CREATESTRUCT cs<br><br> return CView::preCreateWindow(cs);<br>}<br><br><br><br>I have added a HTML resource .<br>I also want the browser functionality i.e <br>void CIEAppView::OnViewRefresh() <br>{<br> // Defer to base function<br> Refresh(); <br>}<br><br>void CIEAppView::OnViewStop() <br>{<br> // Defer to base function<br> Stop(); <br>}<br><br>void CIEAppView::OnGoBack() <br>{<br> // Defer to base function<br> GoBack(); <br>}<br><br>void CIEAppView::OnGoForward() <br>{<br> // Defer to base function<br> GoForward(); <br>}<br><br>void CIEAppView::OnGoHome() <br>{<br> // Defer to base function<br> GoHome(); <br>}<br><br>Will&nbsp;&nbsp;the above functions & the toolbar similar to IE would be coming implicitly<br>just by adding the HTML resource or I have to do something more.<br><br>Zulfi.
 
Same question... Is CIEAppView derived from CHtmlView?<br><br>-pete
 
Sorry I wrongly used the word derive:<br>Actually I am looking for browser functions & the toolbar similar to IE. I think I can get it simply by adding the HTML resource<br>void CIEAppView::OnViewRefresh() <br>{<br> // Defer to base function<br> Refresh(); <br>}<br><br>void CIEAppView::OnViewStop() <br>{<br> // Defer to base function<br> Stop(); <br>}<br><br>void CIEAppView::OnGoBack() <br>{<br> // Defer to base function<br> GoBack(); <br>}<br><br>void CIEAppView::OnGoForward() <br>{<br> // Defer to base function<br> GoForward(); <br>}<br><br>void CIEAppView::OnGoHome() <br>{<br> // Defer to base function<br> GoHome(); <br>}<br>
 
zulfi1234 try looking at this from microsoft:<br><A HREF=" TARGET="_new"> has examples of what you are looking for, though from the look of 'your' sample code above you might have already found it.<br><br>....<br><br>I have a question that you might be able to help with palbano. Do you know a way of trapping when a user Right mouse clicks on a HTML page and clicks Refresh. Or presses F5 to refresh.<br><br>The problem i have is that i don't want specific pages to refresh, or refresh in some specific way and when a user clicks on RMB then chooses refresh it seems that it doesn't call any event handlers.<br><br>Know any way around this?<br><br>Thanks,<br><br>keelwan<br><br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top