Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

history in IE Object

Posted on 2002-07-10
10
Medium Priority
?
340 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 1000 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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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