Solved

Why does my CHtmlView crash on GoBack??

Posted on 2001-06-06
3
396 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating Labels and Frequency list style reports in SAS code 9 92
Named range not carried over 10 62
List out all word 7 260
centeredAverage challenge 8 131
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

920 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

16 Experts available now in Live!

Get 1:1 Help Now