mycraft
asked on
Why does my CHtmlView crash on GoBack??
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
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
can u add the relevant code please
ASKER
OK, here's the relevant code.... though I think it won't help U...
void CSplitterHtmlView::OnComma ndStateCha nge(long nCommand, BOOL bEnable)
{
if (nCommand==CSC_NAVIGATEBAC K)
{
CanBack=bEnable;
}
if (nCommand==CSC_NAVIGATEFOR WARD)
{
CanForward=bEnable;
}
CHtmlView::OnCommandStateC hange(nCom mand, 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"
void CSplitterHtmlView::OnComma
{
if (nCommand==CSC_NAVIGATEBAC
{
CanBack=bEnable;
}
if (nCommand==CSC_NAVIGATEFOR
{
CanForward=bEnable;
}
CHtmlView::OnCommandStateC
}
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"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.