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
 #define/macros
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

yuri
Ketchup Master

USA
85 Posts

Posted - May 12 2004 :  11:19:59 AM  Show Profile
I know this has been talked about. After some searches I did find some answers but given this *really simple* example, why doesn't VAX recognize the type?

#define Vector(value) std::vector<value >
typedef Vector(int) IntVec;

void doStuff()
{
IntVec v;
v.push_back(1);
}

When I type "v." VAX doesn't know what type v is. If I make the typedef the true form, typedef std::vector<int> IntVector, it recognizes it just fine. Is there any reason this doesn't work?

using build 1233 on .NET 2k3

support
Whole Tomato Software

5566 Posts

Posted - May 12 2004 :  11:53:09 PM  Show Profile
We tried your example. It works fine. We get a listbox, tooltip for v appears okay and HCB updates correctly.

Did you try your example in a separate file?

For a shot in the dark, try Rebuild on the Performance node of our options dialog. Restart your IDE.

Whole Tomato Software, Inc.
Go to Top of Page

yuri
Ketchup Master

USA
85 Posts

Posted - May 13 2004 :  07:40:03 AM  Show Profile
Yes, the #define and typedef are in a separate file from the source code using it. I did try rebuilding and restarting the IDE. I will see if putting the #define and typedef in the file using it makes a difference.
Go to Top of Page

yuri
Ketchup Master

USA
85 Posts

Posted - May 13 2004 :  08:25:29 AM  Show Profile
Yes, the example was a bad one because when I tested a map and vector it worked. But the following example still fails. I checked and rechecked. The String class is one of my own but you get the point.

Ok, I have something like the following all in a seperate file:

#if defined(GCC_3_1)
# define HashMap ::__gnu_cxx::hash_map
#elif defined(COMPILER_MSVC)
# define HashMap ::stdext::hash_map
#else
# define HashMap ::std::hash_map
#endif

#define StringHashMap(value) HashMap<String, value, _StringHash>

Then in a separate file I use it:

typedef StringHashMap(int) StringIntHashMap;
void doStuff()
{
StringIntHaspMap test;
test.insert(...);
}

When "test." gets typed it doesn't recognize test as a type. I did rewrite the typedef to read, typedef ::stdext::hash_map<String, int, _StringHash> StringIntHashMap, in the source file and it works fine.

Oh wait, I get it. After typing this up I realized what's going on. VAX can't resolve the type because it has no idea what's defined thus HashMap is referring to an unknown.

If, let's say, I have #defined COMPILER_MSVC in a file wouldn't VAX know which HashMap to use? This is probably a question that has been brought up. I will seach again to see.
Go to Top of Page

yuri
Ketchup Master

USA
85 Posts

Posted - May 13 2004 :  09:05:11 AM  Show Profile
I found the answer.
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=1900

I will try to put the COMPILER_MSVC first and see if that helps.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - May 16 2004 :  10:58:31 PM  Show Profile
Your best option probably is to add a preferred, simple typdef for StringIntHashMap to stdafx.h in the Misc subdirectory of the VA X installation directory. After the change, press Rebuild on our Performance tab and restart your IDE.

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=1900

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000