Link to home
Start Free TrialLog in
Avatar of Susana
Susana

asked on

ToolTip dissapears???

I have developed an aplication with three splitting windows
that show and hide different controls. I've been using CAniButton class to implement the buttons and I wanted to
add tooltips to these buttons so what I did was the following:
 1. I added a  CTipControl variable member to one of the
 view classes
2. I created the tooltip in the OnInitialUpdate of the View
as it is shown next:
void CTextView::OnInitialUpdate()
{
      EnableToolTips(TRUE);
      m_tip.Create(this);
      CFormView::OnInitialUpdate();
      m_tip.AddTool( GetDlgItem(IDC_ABVERPES),"Ver Pesos Optimos");
      m_tip.AddTool( GetDlgItem(IDAB_GUARDAR_PES),"Guardar Pesos");
      m_tip.AddTool( GetDlgItem(IDC_ABPRINTLST),"Imprimir Evolución");
 //...
}

3. I added another function to manage the message:

BOOL CTextView::PreTranslateMessage(MSG* pMsg)
{
      m_tip.RelayEvent(pMsg);      
      return CFormView::PreTranslateMessage(pMsg);
}

The problem is thai ti works fine at the beginning, but after
a while showing and hiding these butttons, the tooltips
dissapear.

Where is the problem???
Avatar of Amaresh080997
Amaresh080997

Hi susana,
    I dont understand what exactly is the problem. You have mentioned "It works well at the beginning". What do you mean? When does it work properly and when does it give problems? What is the exact nature of the problem?Please explain
Thanks
Amaresh
Avatar of Susana

ASKER

What I mean is that after the program has started the tooltips show ok. During the use of he application the buttons
are hiden and disabled, after this action the tooltips don´t work anymore.
But it is quite strange because is after a concret operation in which most of the controls are disabled or hiden and not in other
actions in which the buttons are hiden. It is quite difficult to
explain.

Any cue?
I believe your "m_tip" should be "m_pTip":  a pointer to CToolTipCtrl.
Avatar of Susana

ASKER

To tflai:
Using pointers doesn´t work, or at least I  don´t know how.
It comes up an exception during the creation of the control:

m_pTip->Create(this);

?????
ASKER CERTIFIED SOLUTION
Avatar of Amaresh080997
Amaresh080997

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial