Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Problem with macros and namespaces

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
pwc Posted - Jan 02 2008 : 7:06:27 PM
Hello,

The following code doesn't parse correctly:



#include <vector>


#define DEFINE_TABLE(cls) DEFINE_TABLE_ENTRIES(cls)

#define DEFINE_TABLE_ENTRIES(cls)\	cls::TableEntries  cls::__entries[] = {


namespace
{
	class CMyClass
	{
	private:
		struct TableEntries
		{
			int a,b;
		};
		static TableEntries  __entries[];
	};

	DEFINE_TABLE(CMyClass)
	{0,0},
	{0,0}};

	int GetLineCount(const int& colNames)
	{
		return colNames.size();
	}
}


The argument to the GetLineCount function is not recognized (colNames is underlined in red).

My info:

VA_X.dll file version 10.4.1624.0 built 2007.12.07
Licensed to:
VA X: [email protected] (5-user/10-PC license) Support ends 2008.11.27
DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;

Other Includes:

Stable Source Directories:
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\crt\\src;



9   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 22 2010 : 4:02:40 PM
Unfortunately still no progress, some bugs are harder / slower to address than others. Hopefully the VA StdAfx.h file work around is still working well for you.
pwc Posted - Nov 19 2010 : 11:06:30 AM
Just a friendly ping: still an issue in 1833.
feline Posted - Apr 09 2009 : 5:33:52 PM
Unfortunately this is still in our list of things to fix. This thread should be updated when this bug has been fixed.
pwc Posted - Apr 09 2009 : 4:18:07 PM
Still a problem in 1721.
feline Posted - Jan 19 2008 : 1:35:33 PM
Confirmed. I still wonder if this is related to the namespace problem Uniwares is seeing, but so far I cannot find the connection. I have put in a bug report for this:

case=11586

For now I recommend using the VA stdafx.h file work around.
pwc Posted - Jan 18 2008 : 5:40:34 PM
I tried 1626. It still has this problem.
feline Posted - Jan 08 2008 : 1:56:34 PM
Looking at this, I am wondering if this is similar to the namespaces via #defines problem that a couple of other users are seeing. If so the next version of VA might help. If it does not I will put in a bug report for this.

For now though the stdafx.h work around should help.
pwc Posted - Jan 03 2008 : 2:52:25 PM
Will this be fixed in a future release, or is the workaround the fix?
feline Posted - Jan 03 2008 : 1:49:36 PM
Interesting. Thank you for the clear example, I am seeing the same problem here. For me editing VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and adding the entry:

#define DEFINE_TABLE(cls) {

at the bottom fixes the problem. This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000