Solved

history in IE Object

Posted on 2002-07-10
10
331 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
Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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 …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 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