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
 "Find reference" and inherited method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

enigma
Senior Member

49 Posts

Posted - Mar 04 2007 :  8:51:09 PM  Show Profile  Reply with Quote
"Find references" couldn't seem to find all the instances of virtual and inherited methods.

Let say if I have an abstract method name Demo1() (using vs.net 2003)
protected abstract Demo1();

and I inherit it in my derived classes

protected override Demo1();

Using the "find references" operation will not list down completely all the instances of "Demo1".


http://itscommonsensestupid.blogspot.com/

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 05 2007 :  10:07:18 AM  Show Profile  Reply with Quote
What language are you programming in? This does not look like C++ to me.

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

enigma
Senior Member

49 Posts

Posted - Mar 05 2007 :  7:43:07 PM  Show Profile  Reply with Quote
C#.

Sorry for not making this clear at the outset

http://itscommonsensestupid.blogspot.com/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 06 2007 :  12:21:23 PM  Show Profile  Reply with Quote
using VS2005 and VA 1548 I have added the following code to a C# file:

    abstract class bug_find_references_base
    {
        protected abstract string getNameOfClass();
    }

    class bug_find_references_child : bug_find_references_base
    {
        protected override string getNameOfClass() { return "bug_find_references_child"; }

        public int getLengthOfClassName() { return getNameOfClass().Length; }
    }


when I sit in the base class and trigger Find References on "getNameOfClass" it finds all three references correctly. Is this the sort of thing you are doing, or am I testing the wrong thing?

If this is the right sort of thing can you try copy / pasting this code into one of your files and see what results you get?

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

enigma
Senior Member

49 Posts

Posted - Mar 06 2007 :  7:56:07 PM  Show Profile  Reply with Quote
Try this on vs.net 2003 standard version:
1.Type in the below code
public BaseCase()
{

}

public abstract string MyName
{
get;
}
}

public class DeriveCase1:BaseCase
{
public DeriveCase1():base()
{

}

public override string MyName
{
get
{
return GetType().ToString();
}
}
}
2.

Place your mouse cursor at MyName, and try to find references of it.

3. Observed: Only one instance is found,namely itself, its base class reference cannot be found.
4. Let say if you find to find the MyName at the base class,, VA will correctly return two instances, one in base class, another in derived class

http://itscommonsensestupid.blogspot.com/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Mar 07 2007 :  08:32:31 AM  Show Profile  Reply with Quote
I am seeing the same thing as you now, my mistake. I managed to test the wrong thing on the wrong machine *oops*

Currently Find References does not try to scan the base classes.

This is due to the complications of multiple inheritance, plus overriding virtual functions in core library (stable include directory) classes.

case=3346

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

support
Whole Tomato Software

5566 Posts

Posted - Jan 31 2010 :  1:16:34 PM  Show Profile  Reply with Quote
case=3346 is implemented in build 1810

Whole Tomato Software, Inc.
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