Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ToolTip dissapears???

Posted on 1998-05-28
5
Medium Priority
?
281 Views
Last Modified: 2013-11-19
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???
0
Comment
Question by:Susana
  • 2
  • 2
5 Comments
 

Expert Comment

by:Amaresh080997
ID: 1315688
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
0
 

Author Comment

by:Susana
ID: 1315689
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?
0
 
LVL 4

Expert Comment

by:tflai
ID: 1315690
I believe your "m_tip" should be "m_pTip":  a pointer to CToolTipCtrl.
0
 

Author Comment

by:Susana
ID: 1315691
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);

?????
0
 

Accepted Solution

by:
Amaresh080997 earned 140 total points
ID: 1315692
Hi Susana,
    I will think about your problem. But before that, a quick reply to your "pointer crash" problem. U need to allocate memory before calling "create" function. i.e,
CToolTipCtrl* m_pTip; // declaration in the class

// OnInitialUpdate or OnInitDialog
m_pTip = new CToolTipCtrl;  ===========> This is important. Without this, the program                                                                    will certainly crash when u call "Create"                                                                    function.
I am sure this is why your program crashes when you use pointers. But changing to pointers is unlikely to have any impact on your first question.I will answer that qn later.
Amaresh
0

Featured Post

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!

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

580 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