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
 1430: static_cast in define
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rasmuss
Senior Member

33 Posts

Posted - Nov 11 2005 :  09:12:55 AM  Show Profile  Reply with Quote
When using static_cast in a define "go to" stops working for functions in the inherited class:


class TestBase
{
public:
	void TestBaseFunction();
};

class Test : public TestBase
{
public:
	void TestFunction();
};

extern class TestBase* g_pTestBase;

#define TESTBASE g_pTestBase
#define TESTNOSTATIC_CAST (Test*)TESTBASE
#define TEST (static_cast<Test*>(TESTBASE))
TESTBASE->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TESTNOSTATIC_CAST->TestFunction(); // Works. Goes to definition of TestFunction
TEST->TestFunction(); // Doesn't work, just goes to define

#define TESTBASE2 (static_cast<TestBase*>(g_pTestBase))
#define TEST2NOSTATIC_CAST (Test*)(g_pTestBase)
#define TEST2 static_cast<Test*>(g_pTestBase)
TESTBASE2->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST2->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST2NOSTATIC_CAST->TestFunction(); // Works. Goes to definition of TestFunction
TEST2->TestFunction(); // Doesn't work, just goes to define


I've tried this on some colleagues machines who have older versions of VA:

VA.NET 7.1.1106 works
VAX 10.1.1297.0 works

Regards,
Rasmus Sigsgaard

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 15 2005 :  4:37:10 PM  Show Profile  Reply with Quote
thank you for the clear example, reproduced in VS 2003 C++ with VA 1432

case=876

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

Rasmuss
Senior Member

33 Posts

Posted - Nov 18 2005 :  04:03:03 AM  Show Profile  Reply with Quote
I just tried the rest of the casting operators and none of them work.


#define TESTDYNAMIC (dynamic_cast<Test*>(TESTBASE))
#define TESTREINTERPRET (reinterpret_cast<Test*>(TESTBASE))
#define TESTCONST (const_cast<Test*>(TESTBASE))
TESTDYNAMIC->TestFunction(); // Doesn't work, just goes to define
TESTREINTERPRET->TestFunction(); // Doesn't work, just goes to define
TESTCONST->TestFunction(); // Doesn't work, just goes to define


Regards,
Rasmus
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 19 2005 :  2:54:10 PM  Show Profile  Reply with Quote
that makes sense. i have updated the case with this, so hopefully all of them will be fixed at the same time.

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

Rasmuss
Senior Member

33 Posts

Posted - Mar 08 2006 :  04:27:05 AM  Show Profile  Reply with Quote
Any news on this? Even though I've myself reverted to 1418, I have a lot of colleagues who are now using the newest version, since we just bought a new 45 user license.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Mar 08 2006 :  3:46:16 PM  Show Profile  Reply with Quote
sorry, currently no progress to report on this. i have put a note on the case asking for this to be looked at fairly soon, but i am not sure when this will happen.

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

support
Whole Tomato Software

5566 Posts

Posted - Mar 12 2006 :  3:44:52 PM  Show Profile  Reply with Quote
case 876 is fixed in our forthcoming beta build. (Probably the next general release as well.)
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Apr 14 2006 :  1:17:15 PM  Show Profile  Reply with Quote
Fixed in build 1445.
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