Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

WebBrowser, dynamic content and history

My wtl application uses an html view window as its main view. It should handle static html files and dynamic content. To load a static page I simply navigate to its url on disk and when I have to use dynamic content, I handle the OnBeforeNavigate2 event and inject some html content to it. I have a problem when trying to use the GoBack() and GoForward() functions since I've canceled the original event (in OnBeforeNavigate2) and the browser didn't add the url into history. How can I add the url manually to the history list of the navigation?
0
gilad_no
Asked:
gilad_no
  • 3
  • 3
1 Solution
 
DanRollinsCommented:
Thanks for that excellent problem description.

The window.history object does not expose a collection, so there may not be a way to add anything.  As a first suggestion, you could avoid canceling the OnBeforeNavigate2 and inject the HTML into the DOM after OnDocumentComplete (or whatever).  I'll try a fe things and see if that is feasible...

-- Dan
0
 
gilad_noAuthor Commented:
I can't inject it with OnDocumentComplete because I don't want IE to start and search the url using the default search method. I know there is an interface (ITravelLogStg) to handle the history list, but I can't find it anywhere (I have the latest platform SDK)
0
 
gilad_noAuthor Commented:
I can't inject it with OnDocumentComplete because I don't want IE to start and search the url using the default search method. I know there is an interface (ITravelLogStg) to handle the history list, but I can't find it anywhere (I have the latest platform SDK)
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
DanRollinsCommented:
Get the latest sdk update at: http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

Documentation at:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/travellog/reference/objects/travellogstg.asp

Individual files are here (use the drop-down list and select tlogstg.h and tlogstg.idl(:
http://msdn.microsoft.com/downloads/samples/internet/libraries/ie55_lib/Default.asp

You will need to use the
    ITravelLog.CreateEntry
member function.  An example of usage is here:
http://msdn.microsoft.com/library/en-us/dnwebteam/html/webteam04022001.asp?frame=true#webteam04022001_topic3

-- Dan
0
 
gilad_noAuthor Commented:
I see it only supports IE 5.5. Can't I do something similar with IE 5.01?
0
 
DanRollinsCommented:
Why bother?  Everyone has upgraded to 5.5 or 6 by now.
-- Dan
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now