Author |
Topic |
|
wlater
Senior Member
USA
35 Posts |
Posted - May 13 2009 : 4:27:35 PM
|
I seem to be having a problem with VA (1724 in VS2008) not finding functions defined in afxwin.h. Here is a snippet that shows the problem I'm having:
#define WINVER 0x0502 // Build for Windows XP and later. #include <afxwin.h> void test() { AfxMessageBox("Test", MB_OK); }
VA underlines AfxMessageBox as a misspelled symbol. Also, as I type Afx... VA does not ever offer up AfxMessageBox in the dropdown list. It seems VA has no idea about the existence AfxMessageBox as well as some (but not all) of the other Afx prefixed functions. I checked and the path to afxwin.h is listed in VA's C++ directories. This was happening with some earlier versions of VA as well, so not specific to 1724.
Now this may not be VA's problem because Intellisense also does not seem to know about the existence AfxMessageBox. If I bring up the context menu for it, none of the intellisense related items (Go To Definition, Go To Declaration, etc.) work. I get a symbol is not defined message box displayed by VS. When placed in a single source file, the above code snippet compiles correctly in VS.
So, any ideas? Suggestions to try? Thanks.
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 13 2009 : 7:06:10 PM
|
AfxMessageBox is recognized for me using your code snippet. I can use goto and even the "add include" refactoring to add
#include <afxwin.h>
Can you please create a new win32 test project, to see if this works there? If not, can you please export your VA and IDE settings and send them to me:
VA Options -> Performance -> Export Settings IDE tools menu -> Import and Export Settings -> Export selected environment settings
so I can import and check them here. You mentioned you checked the path settings, but this problem may be caused by something else.
You can send the files by this form:
http://www.wholetomato.com/support/contact.asp
Please include this thread ID or URL in the description, so we can match it up. |
Edited by - accord on May 13 2009 7:11:27 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 14 2009 : 10:49:16 AM
|
I created a Win32 test project and have the same problem. One minor difference however. In the test project, when I hover over AfxMessageBox, I do get a yellow popup box with the two signatures for AfxMessageBox. In my real project, I usually don't get even that, though I beleive I sometimes do.
I've sent my VA and IDE settings as instructed.
Thanks for the help. |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 14 2009 : 11:06:38 AM
|
Another update:
Poking around in my VA user directory, I found that I had renamed the VA StdAfx.h file so that VA would not find it (probably while I was debugging something a few months back). I renamed it back to its regular name and rebuilt the symbol database.
Oddly enough, that seems to have fixed my Intellisense issues with AfxMessageBox in my real project. I now get the yellow popup box with the signatures and the Intellisense options in the context menu now work. Basically, Intellisense now sees AfxMessageBox as a symbol.
However, VA stills underlines it and does not see it as a symbol. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 14 2009 : 7:22:27 PM
|
I got the files, thank you for these. I imported them, and was able to repro the problem. But your paths are on drive N: so your config is a little different. Did you install Visual Studio to drive N: ?
The only thing that *looks* odd is you use "...Windows\\v6.1\\include" directory. I only have "...Windows\\v6.0A\\include" under
VA Options -> Projects -> C/C++ Directories Platform: Win32 Show Directories for: Stable include files
It is probably not a problem, but worth to check: does this directory exist?
N:\\SWE\\Tools\\Microsoft\\SDKs\\Windows\\6.1\\include
Maybe Visual Assist doesn't find a directory, but which? |
Edited by - accord on May 14 2009 7:24:38 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 15 2009 : 10:54:50 AM
|
Visual Studio is installed on my local C: drive. The N: drive is a network drive where we keep a common copy of all of the libraries, etc. It allows us to make sure that all of the developers (as well as our CM and QA) pull from the same exact set. We take a slight performance hit, but it's worth it to us to know we're all working from the exact same common set of includes and libs (we've been burned by that problem in the past).
v6.1 is the SDK for Windows Server 2008 and .NET Framework 3.5. The N:\\SWE\\Tools\\Microsoft\\SDKs\\Windows\\v6.1\\include directory exists and is populated. |
Edited by - wlater on May 15 2009 10:57:47 AM |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 15 2009 : 6:00:08 PM
|
I've done more tests and was able to figure out the problem: you have turned on recursive macro parsing:
http://docs.wholetomato.com?W363
and unfortunately it caused AfxMessageBox to be unrecognized. Turn off this option to solve this problem.
I have put in a bug report for this:
case=27049
Do you need this option to be turned on? |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 18 2009 : 11:49:07 AM
|
Hmmm, I tried turning off recursive macro parsing but I still get AfxMessageBox underlined and unrecognized.
Maybe I did something wrong when turining off recursive macro parsing? I deleted the LimitMacro key and then set the LimitMacroParsing key to 01 as per the instructions. This was with VS exited. After that, ran VS but AfxMessageBox still unrecognized. Just to be sure, I then rebuilt the symbol database. Still no recognition of AfxMessageBox. Here's the export of my VAX registry settings as they stand now:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Whole Tomato] "UNInstall"="Yes"
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Whole Tomato\\Visual Assist X] "InstPath"="C:\\\\Program Files\\\\Visual Assist X" "PackageID"=dword:0de3fe02 "PackageVersionVC9"="1718"
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Whole Tomato\\Visual Assist X\\VANet9] "LimitMacroParsing"=dword:00000001
As to needing the option on, I'm not sure. I remember turning it on a few months back to sort out some other macro problem but I don't remember what it was now (maybe for some of the BoostTest macros). Ah, now I see what it was for. All of the macros (DDX_CONTROL, DDX_TEXT, etc.) in the DoDataExchange dialog method are now also underlined and unrecognized. That's why I had the recursive macro parsing on.
Looks like I'll need to wait for the bug fix. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 18 2009 : 3:43:46 PM
|
Does this happen in a new test project also? Can you send me a project, where you could reproduce this problem with the recursive macro parsing off. |
Edited by - accord on May 18 2009 3:45:56 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 19 2009 : 11:49:56 AM
|
Yes, it happens in a simple test project as well. I have sent you a zipped VS 2008 project. My registry is set the same as my post showed on the 18th. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 19 2009 : 3:19:32 PM
|
Odd. I've imported your settings again, then rebuilt symbol database, and AfxMessageBox was unrecognized as expected. But AfxMessageBox was recognized after deleted LimitMacro, imported your new short reg and rebuilt symbol database.
Still, there is a difference between your and my environment, but what? Can you please go to:
VA Options -> System Info -> Copy Info
and paste the details (from the clipboard) into this thread. This will give us some basic information about your setup, which may give me a clue.
Do you use 32 or 64 bit windows? |
Edited by - accord on May 19 2009 4:42:15 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - May 19 2009 : 7:44:58 PM
|
I use 32-bit Windows XP SP3.
Here's the system info:
VA_X.dll file version 10.5.1724.0 built 2009.05.01 Licensed to: VA X: XXXXXXXXX (6-user license) Support ends 2009.08.21 DevEnv.exe version 9.0.30729.1 msenv.dll version 9.0.30729.1 Font: DejaVu Sans Mono 13(Pixels) Comctl32.dll version 6.0.2900.5512 Windows XP 5.1 Build 2600 S 4 processors (x86)
Platform: Win32 Stable Includes: N:\\SWE\\Tools\\Microsoft\\VC2008\\include; N:\\SWE\\Tools\\Microsoft\\VC2008\\atlmfc\\include; N:\\SWE\\Tools\\Microsoft\\SDKs\\Windows\\v6.1\\include; X:\\SWE\\Tools\\Boost\\boost_1_37_0; N:\\SWE\\Tools\\CppUnit\\include; N:\\SWE\\Tools\\Visual Leak Detector\\Include;
Other Includes:
Stable Source Directories: N:\\SWE\\Tools\\Microsoft\\VC2008\\atlmfc\\src\\mfc; N:\\SWE\\Tools\\Microsoft\\VC2008\\atlmfc\\src\\mfcm; N:\\SWE\\Tools\\Microsoft\\VC2008\\atlmfc\\src\\atl; N:\\SWE\\Tools\\Microsoft\\VC2008\\crt\\src;
|
Edited by - wlater on May 21 2009 10:44:44 AM |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - May 23 2009 : 12:58:34 PM
|
I tried your settings with windows sdk 6.1, boost 1.37.0 and visual lead detector 1.9, but AfxMessageBox is recognized when I limit macro parsing even after i rebuild symbol database.
Have you modified StdAfx.h or StdafxVa.h in VAInstallationDir/Misc ? (C:\\Program Files\\Visual Assist X\\Misc by default) |
Edited by - accord on May 24 2009 11:18:27 AM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - Jun 01 2009 : 11:09:16 AM
|
I definitely haven't modified StdafxVa.h and I'm pretty sure I haven't modified StdAfx.h either. StdafxVa.h has a time stamp of 8/17/2007 8:43 AM and StdAfx.h has 2/19/2009 4:42 PM. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jun 07 2009 : 12:58:27 PM
|
>Maybe I did something wrong when turning off recursive macro parsing? I think you didn't. But to be absolutely sure you can paste the following snippet into a cpp file:
#define DEF1 int Apple; #define DEF2 DEF1 int Banana;
void Func()
{
DEF2;
Apple;
Banana;
}
If Apple and Banana are recognized (alt+g works and they are not underlined after you modify the file) then rec. parsing is turned on otherwise it is turned off (which need to AfxMessageBox be recognized)
Until this problem gets resolved, you can try turning on
VA Options -> Advanced -> Listboxes -> Get content from default Intellisense
to see if this helps. I think it will, since you mentioned "Basically, Intellisense now sees AfxMessageBox as a symbol."
Please report back your results with recursive macro parsing so I'll continue the investigation. It is not an easy case, we may be facing more then one problems with this symbol.
Moreover, you may want to try reinstalling VAX. Is this happening on you collegues' computers as well? Is this a new problem with 1724? If not, do you remember which version was the last one without this kind of problem? |
Edited by - accord on Jun 07 2009 1:01:12 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - Jun 08 2009 : 11:37:55 AM
|
Here's what I get when I paste in your snippet:
Looks like Alt-G works. When cursor placed on Apple or Banana, jumps to DEF2; line. When placed on DEF2, jumps to #define DEF2 line.
Hmmm... so looks like I still have recursive parsing on? Just checked registry again and
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Whole Tomato\\Visual Assist X\\VANet9] "LimitMacroParsing"=dword:00000001
So that's still set for off.
I already have "Get content from default Intellisense" turned on.
Right now I'm using VAX far more than the rest of my colleagues, so I'm not sure if they are seeing the same thing or not. I'll try to check.
I did notice this before 1724, but not sure how many versions back.
I think it may be time for a reinstall. I'll try to do that later this week. |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - Jun 10 2009 : 1:58:53 PM
|
OK, I uninstalled 1724 and then re-installed it. Here's my complete test case file:
So looks like recursive parsing is turned off, but I still have AfxMessageBox unrecognized. |
Edited by - wlater on Jun 10 2009 2:06:54 PM |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - Jun 15 2009 : 11:25:53 AM
|
Installing 1727 seems to have fixed the problem.
So whether an intentional fix in 1727 or not, thanks.
Thought I should also mention that there is a very minor bug in 1727 that has been in the past few releases as well. If the user has changed the VA X Find Result color from the default and then updates VA X, VA X will show find results using the default color (yellow background I believe) after the update. If you go to Tools/Options/Fints & Colors, VA X Find Result still shows the user defined color and if OK is pressed, VA X will display the user defined color for find results from then on. A very minor bug with an easy workaround, but I thought I should let you know.
|
Edited by - wlater on Jun 15 2009 11:27:28 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - Jun 15 2009 : 12:03:07 PM
|
If you are talking about the item "VA X Find Result" in the IDE options dialog then this can only be set in the IDE options dialog. This colour is not listed in the VA Options dialog.
You can change the two colours used by Find References in the VA options dialog, but these are different colours / settings. |
zen is the art of being at one with the two'ness |
|
|
wlater
Senior Member
USA
35 Posts |
Posted - Jun 15 2009 : 1:46:00 PM
|
Yes, I was referring to the "VA X Find Result" color in the IDE options. When I referred to Tools/Options/Fonts & Colors, I meant in the IDE, not the VA options.
That doesn't change the problem though. When you intall a VA X update, the default (yellow background) is used, not the color defined for "VA X Find Result" under Tools/Options/Fonts & Colors. At least not until you go to that IDE window and press OK at least once.
I hope that's more clear. |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Jun 15 2009 : 3:23:14 PM
|
Also, I've seen this effect when I installed 1727, and I was able to reproduce the problem again:
case=28318
Glad your other and bigger problem had been resolved. I was setting up a test parsing through network, but now it's needless. |
Edited by - accord on Jun 15 2009 3:24:57 PM |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Oct 06 2009 : 12:10:59 PM
|
case=28318 was fixed in build 1731 |
|
|
|
Topic |
|