Solved

ToolTip dissapears???

Posted on 1998-05-28
5
266 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 70 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

770 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