?
Solved

Tool tip

Posted on 1999-08-02
1
Medium Priority
?
222 Views
Last Modified: 2010-04-02
In my dialog based application for some components I would like to show the tooltip. I am doing this code.
In header file dlg.h
 CToolTpCtrl tooltip;
In cpp file dlg.cpp
  in the method           m_ToolTip.AddTool((CButton*)GetDlgItem(IDOK),"Open",NULL,0);
  in  OnMouseMove()
    m_ToolTip.Activate(true);
    m_ToolTip.SetDelayTime(10);
But tooltip is notvisible. Can you please help me out in this regardd??
Thanks

0
Comment
Question by:bmuralimohan
[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
1 Comment
 

Accepted Solution

by:
wooper earned 0 total points
ID: 1201662
Your code is right bmuralimohan, you've just to add the following method in your class in order to able the ToolTip control to process its message:

In the header:

      BOOL PreTranslateMessage(MSG* pMsg);

in the implementation:

BOOL YOUCLASSHERE::PreTranslateMessage(MSG* pMsg)
{
      // Let the ToolTip process this message.
      mytooltip.RelayEvent(pMsg);
      return CDialog::PreTranslateMessage(pMsg); // used for a dialog based application.
}


Note: You can do all the tooltip's initialisation at the same time, so you don't have to use it into your OnMouseMove method.

BOOL YOUCLASSHERE::OnInitDialog()
{
      CDialog::OnInitDialog();

      mytooltip.Create(this);
      mytooltip.Activate(TRUE);
      mytooltip.AddTool(GetDlgItem(IDOK), "This is a sample");

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

719 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