Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1549: another Alt-G problem (VS2005)

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
kai Posted - Mar 26 2007 : 12:30:47 PM
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 ...
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 27 2007 : 11:26:37 AM
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.
kai Posted - Mar 27 2007 : 10:09:54 AM
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.
feline Posted - Mar 26 2007 : 3:51:45 PM
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
kai Posted - Mar 26 2007 : 1:32:12 PM
Ah, ok. First i thought that enabling it might be an obvious (RTFM) way to fix my problem :-).
rhummer Posted - Mar 26 2007 : 1:16:08 PM
IIRC that option was eliminated with build 1543, but some how it crept back into the Dialog.
kai Posted - Mar 26 2007 : 12:39:30 PM
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.

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