Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ToolTip dissapears???

Posted on 1998-05-28
5
Medium Priority
?
278 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
[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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

610 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