Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1530: Tooltips never show correct info...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 27 2006 :  4:44:53 PM  Show Profile  Reply with Quote
Hi,

Somehow, the Tooltips never show the correct info while typing in Method-Parameters...

See:






I am missing the (correct) entry:
int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType );

Help?!?

jpizzi
Tomato Guru

USA
642 Posts

Posted - Jul 28 2006 :  02:32:17 AM  Show Profile  Reply with Quote
What does your include list look like? When I #include <Windows.h>, I get the tooltip you are looking for (well, almost; mine has __inline in front of it).

I am thinking that this is one of those functions that is declared all over the place, and VA is just finding some others first.

Joe Pizzi
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 28 2006 :  05:50:50 AM  Show Profile  Reply with Quote
In GraphicLib.cpp:
#include <Windows.h>
#include <GdiPlus.h>

In GraphicLib.h:
- NONE -

In GraphicLibTester.cpp (where the Screenshots above are from):
#include <windows.h>
#include "resource.h"
#include "../GraphicLib/GraphicLib.h"

Apart from Windows.h and Gdiplus.h, no Headers included...
GraphicLib is a DLL, within which I wrap some Gdiplus-Methods.

GraphicLibTester simply is a small Application which provides some testing for my DLL/Lib.

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 29 2006 :  1:05:21 PM  Show Profile  Reply with Quote
which IDE are you using?

in C++, VS2005 i get the same three suggestions as you. after disabling VA i get no suggesions at all when pressing CTRL-ALT-SPACE.

switching to a MFC project, the nearest i can get, with VA *disabled* is this:



notice that this is an IDE tooltip, and it is for MessageBoxA, not MessageBox, which is what i typed. if i enable VA and call MessageBoxA() then i get the parameter list you are looking for.

zen is the art of being at one with the two'ness

Edited by - feline on Jul 29 2006 1:05:41 PM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 29 2006 :  6:50:17 PM  Show Profile  Reply with Quote
Hi Colin,
I'm using Visual Studio 2005...

Strange thing:
The "Context and Definitions" Fields on top do actually show the "correct" Info... it's just that the Tooltips show some strange definitions of MessageBox...


Edited by - WannabeeDeveloper on Jul 29 2006 6:52:42 PM
Go to Top of Page

beef
Senior Member

Poland
42 Posts

Posted - Jul 30 2006 :  11:29:02 AM  Show Profile  Reply with Quote
Maybe this will be helpful in the furher invstigation: these declarations comes from the MFC version (where MessageBox is defined within CWnd, thus, does not require HWND). VAX simply takes the MFC version first, even when no MFC header is in use. I see the same behaviour from time to time in my project - not using MFC at all, just creating class named CObject totally confuses VAX. I've got used to live with this :)

Edited by - beef on Jul 30 2006 11:39:13 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 30 2006 :  2:40:43 PM  Show Profile  Reply with Quote
WannabeeDeveloper, for me, using VS2005 and VA 1530, in a MFC project, the VA wizard bar shows the details of the three parameters for MessageBox()

i can only get it to show the 4 parameters by changing the call to MessageBoxA(). can you reproduce this effect on demand, in a small test project?

the fact that VA shows one set of information, but the IDE shows a different set is certainly a problem.

case=1888

zen is the art of being at one with the two'ness
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 31 2006 :  05:24:25 AM  Show Profile  Reply with Quote
So I should just replace the MessageBox in the Screenshots to MessageBoxA and test what the tooltip shows?

I'll do this evening, as soon as I'm back home and post the result...

Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Jul 31 2006 :  5:03:29 PM  Show Profile  Reply with Quote
As soon as I use MessageBoxA/W, I get the correct tooltips for the parameterlist while typing in the parameters...

Hovering over "MessageBox" shows "#define MessageBox MessageBoxW"
Hovering over "MessageBoxA" shows the correct, desired Info ("int MessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType)")...

I was wrong about the "Context and Definition" Comboboxes, they also show the incorrect Parameter-Infos when using "MessageBox" (showing "int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK)"). They are correct when using A/W Versions directly, showing "WINUSERAPI int WINAPI MessageBoxA( __in_opt HWND hWnd, __in_opt LPCSTR lpText, __in_opt LPCSTR lpCaption, __in UINT uType)"...

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jul 31 2006 :  5:48:48 PM  Show Profile  Reply with Quote
that makes sense.

at a guess the IDE is looking up the correct form of the function call, based on your preprocessor definitions, and then giving you that tooltip.

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Jul 31 2006 :  11:03:41 PM  Show Profile  Reply with Quote
quote:
originally posted by feline
based on your preprocessor definitions

I thought we claimed that didn't happen??

Joe Pizzi
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Aug 01 2006 :  02:25:28 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

that makes sense.

at a guess the IDE is looking up the correct form of the function call, based on your preprocessor definitions, and then giving you that tooltip.



Huh?

Based on which preprocessor definitions?

Those "3-parameter-Messageboxes" seem to come from MFC, and I never ever really even thought about ever using MFC in my whole life...

The Tooltip is damn wrong, if it is showing me MFC-stuff when I am NOT using MFC...
So what's the point in showing me 3 wrong tooltip infos while I am typing-in a method/function that does have nothing in common with the "help" the tooltip should provide except for the name of the function?

Especially, when the IDE shows the correct info when VAX is disabled...

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Aug 01 2006 :  6:27:38 PM  Show Profile  Reply with Quote
lets have another go at this.

jpizzi, i looks like the IDE, NOT VA, is looking at something, i am guessing a pre-processor definition.

going alt-g on MessageBoxA(...) takes me to "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include\\winuser.h"

which contains the code:

#ifdef UNICODE
#define MessageBox  MessageBoxW
#else
#define MessageBox  MessageBoxA
#endif // !UNICODE


for me, in VS2005, MessageBoxW is shown in grey, since i do NOT have UNICODE defined as one of my pre-processor definitions. this is a new feature of VS2005, it syntax highlights disabled blocks of code based on your current pre-processor definitions. this has nothing to do with VA.

now look at the screen shot i posted:



this is an IDE tooltip. notice the function name i typed is MessageBox(...), but the function in the tooltip is MessageBoxA(...)

my working theory is that the IDE is looking at MessageBox(...), resolving the #define, and then giving you the tooltip from the resolved function, while VA is not.

i agree this is a problem with VA, which is why i have raised a case for this.

my reference to MFC came from one simple fact, i could not reproduce this effect sensibly in my Qt Windows project. i do all of my own windows programming using Qt 3.x, so the raw Win32 API, and MFC, and all such things, are largely unknown to me. it probably does not have anything to do with MFC, but it probably is related to the #include lines, or project settings.

does this make more sense?

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000