Solved

history in IE Object

Posted on 2002-07-10
10
318 Views
Last Modified: 2013-11-20
Hi all,
   I use CHtmlView in my app and I can go back and go forward in history with  GoBack() and GoForward() funtion.  But I have some question How can I know the end of history
so I can disable the back button or forward button.

Does anyone has any idea please suggest me.?
0
Comment
Question by:eakkung
[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
  • 2
  • 2
10 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7143225
Try

IOmHistory Interface
0
 

Author Comment

by:eakkung
ID: 7145023
do you have any sample? I don't know how to use it.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7145196
Find "HOWTO: Disable the Default Pop-up Menu for CHtmlView" in MSDN, you can find how to get IWebBrowser2.

From IWebBrowser2, yu will get the IOmHistory.

Good Luck
0
Technology Partners: 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!

 

Author Comment

by:eakkung
ID: 7145638
I used  code like this to get interface
 
     IOmHistory* m_phistObj;
     HRESULT hr1 = lpUnk->QueryInterface(IID_IOmHistory, (void**) &m_phistObj);

but I can not get it. Do you have any idea to suggest me.

I upgrage point to 250
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 7145760
Please wait

I'm looking into the problem..
0
 

Expert Comment

by:JaguarWinner
ID: 7923294
use CHtmlView::OnCommandStateChange(long nCommand,BOOL bEnable) message handle,program like this:

CMyView::OnCommandStateChange(long nCommand,BOOL bEnable)
{
   switch(nCommand)
   {
   case CSC_NAVIGATEBACK:
      BackButton.Enable=bEnable;
      break;
   case CSC_NAVIGATEFORWARD:
      ForwardButton.Enable=bEnable;
      break;
   default:
      break;
   }
}
0
 

Accepted Solution

by:
JaguarWinner earned 250 total points
ID: 7923428
In addition,you could disable or enable the toolbar's button with this code:

//in the Message Map for CMainFrame
ON_UPDATE_COMMAND_UI(ID_GO_BACK, OnUpdateGoBack)
ON_UPDATE_COMMAND_UI(ID_GO_FORWARD, OnUpdateGoForward)
...

//OnUpdateGoBack function
void CMainFrame::OnUpdateGoBack(CCmdUI* pCmdUI)  
{
   pCmdUI->Enable(m_bBackBtnEnabled);
}
//OnUpdateGoForward function
void CMainFrame::OnUpdateGoForward(CCmdUI* pCmdUI)  
{
   pCmdUI->Enable(m_bForwardBtnEnabled);
}

//your CHtmlView code
CMyView::OnCommandStateChange(long nCommand,BOOL bEnable)
{
  CMainFrame* pMF=(CMainFrame*)AfxGetApp()->m_pMainWnd;
  switch(nCommand)
  {
  case CSC_NAVIGATEBACK:
     pMF->m_bBackBtnEnabled=bEnable;
     break;
  case CSC_NAVIGATEFORWARD:
     pMF->m_bForwardBtnEnabled=bEnable;
     break;
  default:
     break;
  }
}
0

Featured Post

Independent Software Vendors: 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
Replacement selected text 2 65
sum13 challenge 24 133
Problem to event 3 112
How do I get Window Title of all opened process? 4 32
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

735 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