T O P I C R E V I E W |
WannabeeDeveloper |
Posted - Jul 27 2006 : 4:44:53 PM 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?!?
|
12 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Aug 01 2006 : 6:27:38 PM 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? |
WannabeeDeveloper |
Posted - Aug 01 2006 : 02:25:28 AM 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...
|
jpizzi |
Posted - Jul 31 2006 : 11:03:41 PM quote: originally posted by feline based on your preprocessor definitions
I thought we claimed that didn't happen?? |
feline |
Posted - Jul 31 2006 : 5:48:48 PM 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. |
WannabeeDeveloper |
Posted - Jul 31 2006 : 5:03:29 PM 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)"...
|
WannabeeDeveloper |
Posted - Jul 31 2006 : 05:24:25 AM 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...
|
feline |
Posted - Jul 30 2006 : 2:40:43 PM 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 |
beef |
Posted - Jul 30 2006 : 11:29:02 AM 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 :) |
WannabeeDeveloper |
Posted - Jul 29 2006 : 6:50:17 PM 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...
|
feline |
Posted - Jul 29 2006 : 1:05:21 PM 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. |
WannabeeDeveloper |
Posted - Jul 28 2006 : 05:50:50 AM 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.
|
jpizzi |
Posted - Jul 28 2006 : 02:32:17 AM 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. |
|
|