Solved

ToolTip dissapears???

Posted on 1998-05-28
5
262 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
Comment Utility
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
Comment Utility
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
Comment Utility
I believe your "m_tip" should be "m_pTip":  a pointer to CToolTipCtrl.
0
 

Author Comment

by:Susana
Comment Utility
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 70 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now