Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Modifying tooltips

Posted on 2004-09-19
7
Medium Priority
?
336 Views
Last Modified: 2013-11-20
How can I modify the tooltips the MFC displays in the SDI/MDI application? I want them to be dynamically-adjustable, for instance, for the tooltip which corresponds to Undo I want to show something like "Undo: 5 more available".
0
Comment
Question by:Lescha
[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
  • 3
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 320 total points
ID: 12095138
0
 
LVL 2

Expert Comment

by:bcsonka
ID: 12096287
Hi,

Try using the CToolTipCtrl::UpdateTipText method.  Here's an example:

================================================================================

CString tooltipMsg = "My updated tooltip text";
tooltip->UpdateTipText(tooltipMsg, cwndPtr);

================================================================================

tooltip ==> pointer to an instance of CToolTipCtrl
cwndPtr ==> pointer to the control to contain the updated tooltip text (CWnd*)

I hope that helps.
0
 
LVL 1

Author Comment

by:Lescha
ID: 12149638
Alex, could you please explain to me why there are 4 possibilities in the code? I thought Unicode would work only with one of *A or *W functions/types (which one, by the way?), and non-unicode with the other.

bcsonka, would that things could be that simple. I don't think there is a way of actually obtaining those pointers. If you know one please tell.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 48

Expert Comment

by:AlexFM
ID: 12150457
There are two messages: TTN_NEEDTEXTA and TTN_NEEDTEXTW. Program may be in two configurations: ANSI and Unicode. This code is written by safety way, so that it is ready to handle TTN_NEEDTEXTW in ANSI configuration. I am not sure that this can actually happen, but safety is always good.
0
 
LVL 1

Author Comment

by:Lescha
ID: 12153369
Okay... but don't I actually control whether or not my program is Unicode? Why bother with this #ifndef stuff?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 12153610
This means, you always work in ANSI configuration created by VC++ by default. But you can add UNICODE configuration to your project and work in it (this is a best choice for WinNT and later). The code from this sample is OK both for UNICODE and ANSI configurations. You can read more information here:
http://www.codeproject.com/cpp/unicode.asp
 
0
 
LVL 1

Author Comment

by:Lescha
ID: 12153621
Okay, thanks.
The answer most probably will go to Alex, but I'll wait for bcsonka for a day or two.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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