Solved

Why does my CHtmlView crash on GoBack??

Posted on 2001-06-06
3
423 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
[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
3 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6159240
can u add the relevant code please
0
 

Author Comment

by:mycraft
ID: 6159976
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
ID: 6162558
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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 169
no14 challenge 14 73
child constructor and parent constructor, overriding and overloading 6 93
scoreUp challenge 14 69
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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