|
Hi,
First thing you need to do is create a window for your tooltips. ex:
<br />
hwndToolTips = CreateWindow ( TOOLTIPS_CLASS, NULL, WS_POPUP, 0,0,0,0, hwndParent, NULL, hInstance, 0 );<br />
Once, you've created the tool tip window, you have to activate tooltips, do this by sending the TTM_ACTIVATE message to the Tool tip window (hwndToolTips).
Now, you can add tool tip to either a control or a rectangular area of the parent window. To add a tooltip, simply send the message:
SendMessage ( hwndToolTips, TTM_ADDTOOL, 0, &tooltip );
where "tooltip" is a TOOLINFO structure. (see MSDN)
There are more messages for tooltips, just look up "TTM_" in MSDN. You don't have to worry about destroying the tool tip window, Windows will take care of it for you since its a child of "hwndParent".
Fortran
|
|
|
|
|
Fortran and Neha, I am having the same type of problem that the original thread speaks of. I have created a window and I am sure that is being done correctly. I also set the position of the window, where I would like the tooltip to appear. The problem is, my call to add and activate the tooltip keeps failing. I am hoping by replying to this thread it will somehow get to one of you and you might be able to give me some insight. The following code is how I am initializing the toolinfo structure. Any help you might be able to provide would be greatly appreciated.
/* INITIALIZE MEMBERS OF THE TOOLINFO STRUCTURE */
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.hwnd = hwnd;
ti.hinst = _Module.GetModuleInstance();
ti.uId = (UINT_PTR)hwnd;
ti.lpszText = (LPTSTR)wszTTtext;
// ToolTip control will cover the whole window
ti.rect.left = rect.left;
ti.rect.top = rect.top;
ti.rect.right = rect.right;
ti.rect.bottom = rect.bottom;
if(!SendMessage(hwndTT,TTM_ACTIVATE,(WPARAM)TRUE,0)){
WriteLog(_T(" > Could not Activate TooltipControl\r\n"));
}
/* SEND AN ADDTOOL MESSAGE TO THE TOOLTIP CONTROL WINDOW */
if(!SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti)){
WriteLog(_T(" > Did not Create TooltipControl\r\n"));
}
|
|
|
|
|
I'm using CPaintDC class for drawing directly on a window.
Right now I would like to draw into a CBitmap object and then copy it to screen to avoid blinking and to make imege storing possible.
Any simple way to create CPaintDC that draws into CBitmap object?
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
[CoY0te] wrote:
Any simple way to create CPaintDC that draws into CBitmap object?
Actually, it'll be CDC (not CPaintDC) which draws into CBitmap. There should be CMemDC class rigt here on CP which does exectly that.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Thank You. I would probably spend some time looking for it in the MSDN before i would find out that MFC doesn't support drawing into CBitmap this way. I'll check out that CMemDC class right now.
Thank You again.
Greetings from Poland, heh.
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
Hi!
I would like to get a message when a key is pressed in a dialog box. But my Dialog Procedure doesn't receive the Windows WM_CHAR, WM_KEYDOWN or WM_KEYUP messages. I think is due to the fact that another control got the focus, for example a button.
Is there a way that my Dialog Procedure receive theses messages anyway, like in Visual Basic for example when the KeyPreview property is set to true?
Thks in advance!
Appstmd
|
|
|
|
|
In MFC, PreTranslateMessage would be a good place to check for WM_CHAR. If you're on Win32 API, things are more complicated...
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
|
Thanks you, but I don't use MFC. I'm programming with the Win32 API. Is there an equivalent to the PreTranslateMessage in Win32 API?
Thks in advance!
Appstmd
|
|
|
|
|
Hi,
Strange problem... I've constructed a dll (mfc extention) with VC++ 6.0 for another application that use it.
The project of this DLL use 2 files added:
ExportFile.h and ExportFile.cpp
where we can found for ExportFile.h:
#ifndef __EXPORTFILE_H_
#define __EXPORTFILE_H_
#define DLLEXPORT _declspec(dllexport)
typdef struct {
BYTE member1;
BYTE member2;
} TCHA_DIG;
DLLEXPORT DWORD Init(TCHA_DIG* channel);
DLLEXPORT void StartAcquisition(TCHA_DIG channel);
#endif
And for ExportFile.cpp
#include "stdafx.h"
#include "ExportFile.h"
DWORD Init(TCHA_DIG* channel)
{
return 0;
}
Ther's no error and no linking problem when I compile this project
The application (which use this DLL) use the file MyProject.lib and ExportFile.h well (the settings are good).
The problem is as follows:
when I start the application (which use the DLL) a message box tell me
"The entry point for ?StartAcquisition@@YAXPAUTCHA_DIG@@@Z procedure was not found in the Dynamic Linking Library MyDLL.DLL"
But, the most strange is that all is OK on my OTHER PC...(the 2 PC work with win2k and VC++ 6.0)
Please help me... thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
Maybe (and if thats not the case I apologize), but maybe you have at the Application directory an older version of the Dll you once developed. check if the app is looking for the right dll and the right lib.
Guy.
|
|
|
|
|
Of course... Thanks for this answer...
Hello World!!!
from Raphaël
|
|
|
|
|
As far as I know, if You put function declaration in the .h file, but don't place it's definition in a .cpp file the likner and the compiler will not report any error unless You try to use this function somewhere.
I assume You have the code for StartAcquisition in Your .cpp file (at least an empty function) ?
If yes, then I'm surprized with that "no entry point" too.
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
The problem comes owing to the fact that I left an old version of this DLL.
Moreover, I used the new lib file generate (and the old dll)...
Thanks nevertheless...
Hello World!!!
from Raphaël
|
|
|
|
|
Use extern "C" :
extern "C"
{
DLLEXPORT DWORD Init(TCHA_DIG* channel);
//[... other DLLEXPORT...]
DLLEXPORT void StartAcquisition(TCHA_DIG channel);
}
|
|
|
|
|
I often heard about this syntax but which are its advantages???
I observed with this syntax another arrangement of the *.lib file... Why???
Thanks...
Hello World!!!
from Raphaël
|
|
|
|
|
how can i store 30 digits number in an int variable. if it is possible, then plz help me regarding this problem.
|
|
|
|
|
|
how to use that (__int64), it's not a data type, plz reply
|
|
|
|
|
|
No, __int64 is a native (but non-standard) datatype available in VC6 as well.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
|
Nishant S wrote:
You'll need the new Platform SDK or VC++.NET
Sure?
I use it since good old Visual C++ 4.x day...
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
|
Do you actually need to do mathematical operations on this number, or is it just to store it. If you just need to store, then you could put it in a string or char array
--
Help me! I'm turning into a grapefruit!
|
|
|
|