Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
325 views
in Technique[技术] by (71.8m points)

c++ - How do I see the where class OBJECTS are declared and defined using solution explorer in Visual Studios 2015?

I'm using Visual Studios 2015.

I'd like to see where a class object is declared and defined in my code.
E.g. Where are statements like myClass object1;?

Also, is there a way to use the find all references tool on a class method and not see other classes' methods of the same name?
E.g. We have myclass1::Run(), myclass2::Run() and perhaps a variable Run somewhere. Can I specify which kind of reference I'm looking for?

Simple questions, but I haven't been able to find the answers elsewhere.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In Visual Studio 2019, the Find All References command should do exactly what you want. It should automatically return only the references for the particular type or member that you selected, not other symbols that happen to have the same name.

To be clear, the way I use the Find All References command does not involve the Solution Explorer. Rather, I select the name in the code editor, right-click and choose Find All References (or press a keyboard shortcut, usually F4). That approach works in VS 2015, 2017, and 2019, etc. However, the results window changed drastically from VS 2015 to VS 2017 and newer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...