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
 1549: another Alt-G problem (VS2005)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kai
Junior Member

11 Posts

Posted - Mar 26 2007 :  12:30:47 PM  Show Profile  Reply with Quote
Alt-G does not work with some framework classes i'm using. I've stripped the code down to the following snippets:

AltGTest.h:
#ifndef _ALT_G_H_
#define _ALT_G_H_

#define STRUCT class

STRUCT A 
{ 
  public:
    int do1() const;
};
STRUCT B : public A
{
  public:
    int do2() const;
};
STRUCT C : public B
{
  public:
    int do3() const;
};

#endif


AltGTest.cpp:
#include "codec.h"

A::do1() const { /* do nothing */ }
B::do2() const { /* do nothing */ }
C::do3() const { /* do nothing */ }


Alt-G does work for A::do1() but it does not work for do2/3.

I know that it may not be recommended to redefine C++ keywords via macros but as said before the original code is part of a framework i'm using and i cannot change it ...

Edited by - kai on Mar 26 2007 12:41:04 PM

kai
Junior Member

11 Posts

Posted - Mar 26 2007 :  12:39:30 PM  Show Profile  Reply with Quote
Another thing is noticed: I cannot activate the 'Evaluate all macros used in definitions' item in the C/C++ options. If i click on it its checkbox actually gets ticked, but the next time i open the dialog it is disabled again.

Edited by - kai on Mar 26 2007 12:41:38 PM
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Mar 26 2007 :  1:16:08 PM  Show Profile  Reply with Quote
IIRC that option was eliminated with build 1543, but some how it crept back into the Dialog.

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

kai
Junior Member

11 Posts

Posted - Mar 26 2007 :  1:32:12 PM  Show Profile  Reply with Quote
Ah, ok. First i thought that enabling it might be an obvious (RTFM) way to fix my problem :-).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 26 2007 :  3:51:45 PM  Show Profile  Reply with Quote
For the alt-g problem, edit VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the entry:

#define STRUCT class

at the bottom. 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

this is:

case=275

but in this case this workaround fixes the problem, at least in my tests.

The option about macro's coming back when it is not supposed to is:

case=3955

zen is the art of being at one with the two'ness
Go to Top of Page

kai
Junior Member

11 Posts

Posted - Mar 27 2007 :  10:09:54 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline

For the alt-g problem, edit VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the entry:

#define STRUCT class



Yes, it's working here too. Thanks!

Can you actually provide some hints about the typical candidates which need to be put in this file? Unfortunately this framework we're using includes a lot of (sometimes complicated) macro definitions and i'm often experiencing problems with Alt-G and, even more frequently, code completion does not work (which is strange sometimes because i can often see the available functions in the hovering class browser). If i can fix this using stdafx.h, this would really be nice.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 27 2007 :  11:26:37 AM  Show Profile  Reply with Quote
StdAfx.h is parsed before any of your code or libraries, and can be used to help with difficult code, or sometimes to hide it, by using a #define like:

#define DIFFICULT_MACRO

or even:

#define DIFFICULT_MACRO //

without seeing some more examples of your code I am not sure what to suggest, but these two examples are a common approach I take when I need to use VA's stdafx.h to help. At the most basic level think of it as a good way of simply hiding code from VA.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000