Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 conditional namespace definition not recognized

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
sl@sh Posted - Jan 15 2007 : 05:54:38 AM
For switching between different implementations of an interface I am using namespaces like this:


#ifdef NEW_VERSION
namespace new_version_namespace
#else
namespace old_version_namespace
#endif
{
    int Foo();
    void Bar();
}
#ifdef NEW_VERSION
using namespace new_version_namespace;
#else
using namespace old_version_namespace;
#endif


I have two different implementation files that I include in the project, but only the implementations of one of the namespaces will be used, depending on the define.

Unfortunately, VAX doesn't recognice the symbol new_version_namespace, regardless on whether or not the macro symbol NEW_VERSION is defined or not (not even when I place a #define right on top of the namespace definition). It's always underlined with a red wriggly line. If I use the namespace symbol though, and append a '::', I get prompted with a listbox of symbols defined in the namespace, so after all VA *does* know the symbol, it just pretends to not know it ....
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 16 2007 : 09:02:49 AM
I am seeing the same effect here. I have put in a case for the parameter info tooltips not appearing

case=4559

and I have also put in a case for the namespace name being underlined

case=4560
sl@sh Posted - Jan 16 2007 : 03:26:22 AM
Interesting - I would have expected VAX to not recognize the namespace members correctly with imbalanced brackets within a define, that's why I didn't even try. However, this doesn't really fix the problem except for the underlining - for instance when I have a member function
int foobar(const char* name);
and choose it from the completion listbox after '::', VAX does not suggest any parameter list(s) for the function, even after explicitely typing ALT-TAB. When I just type
foobar(|)
however (someplace after the using statement), I get a suggestion listbox providing the correct parameter list (at the text cursor position marked by |).

IDE VS 2003

VA X Version Info:

VA_X.dll file version 10.3.1543.0 built 2006.12.19
Licensed to:
VA X: [email protected] (3-user license) Support ends 2007.09.23
VAOpsWin.dll version 1.3.4.1
VATE.dll version 1.0.5.5
DevEnv.exe version 7.10.3077.0
msenv.dll version 7.10.3077.0
Font: Courier New 13(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include\\prerelease;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\crt\\src;

Other Includes:

feline Posted - Jan 15 2007 : 1:15:39 PM
The first part of the answer is this FAQ:

http://docs.wholetomato.com?W321

I am seeing the same underlining problem here, and was able to fix it by changing the code to read:

#ifdef NEW_VERSION
namespace new_version_namespace
{
#else
namespace old_version_namespace
{
#endif
	int Foo();
	void Bar();
}
#ifdef NEW_VERSION
using namespace new_version_namespace;
#else
using namespace old_version_namespace;
#endif


however I suspect this will cause problems, since the curly brackets are now unbalanced.

Which IDE are you using? I am seeing a different behaviour on "new_version_namespace::", specifically no completion listbox and the IDE complains about this being unknown.

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