Solved

Why does my CHtmlView crash on GoBack??

Posted on 2001-06-06
3
382 Views
Last Modified: 2013-11-20
Hi folks,
I'm trying to figure out why the Webbrowser crashes when I try to go back even if it's "allowed".

My App looks like this: I've got a SDI-Window with a Splitterwindows. On the left side, there's a CTreeView filled with an ActiveX OCX. My ChtmlView is in the right pane.
When I start the prog, the CHtmlView navigates to title.htm.
Of course, I monitor OnCommmandStateChange...
Now, when I click something in the Treeview that makes the CHtmlView navigate, I can go back (using GoBack() ) without problems.
But if I click on a Link in the initial title.htm and then want to go back....CRASH. Looks like the CommandStateChange has been sent, though the CHtmlView isn't able to GoBack....

plz HELP


0
Comment
Question by:mycraft
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
can u add the relevant code please
0
 

Author Comment

by:mycraft
Comment Utility
OK, here's the relevant code.... though I think it won't help U...

void CSplitterHtmlView::OnCommandStateChange(long nCommand, BOOL bEnable)
{

     if (nCommand==CSC_NAVIGATEBACK)
          {
          CanBack=bEnable;
          }
     
     if (nCommand==CSC_NAVIGATEFORWARD)
          {
          CanForward=bEnable;
          }

     CHtmlView::OnCommandStateChange(nCommand, bEnable);
}

and when the user clicks "Forward" (pMyView is a pointer to the actual CSplitterHtmlView-Object; CSplitterHtmlView is derived from CHtmlView):

void CMainFrame::OnNext()
{
     if (CanForward) pMyView->GoForward();

     // TODO: Add your command handler code here
     
}

same for "Back"
0
 
LVL 2

Accepted Solution

by:
xu2000 earned 100 total points
Comment Utility
Hi,
How do you get the pMyView? Check pMyView is not NULL.

You can try change "pMyView->GoForwoard();" to DYNAMIC_DOWNCAST(CSplitterHtmlView, m_wndSplitter.GetPane(0,1))->GoForward();

My 2 cents
Xu
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 20
notReplace  challenge 53 102
tripleUp challenge 7 65
pre4 challenge 19 87
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

7 Experts available now in Live!

Get 1:1 Help Now