Solved

Why does my CHtmlView crash on GoBack??

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
no14 challenge 14 67
isEverywhere  challenge 19 75
Line meaning 9 85
Detect file exist or not 3 157
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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…

773 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