Visual Studio Go to Definition

Go to definition in Visual Studio 2005 only works for files that are in my project. It never works for files that are included in external libraries such as mfc. When I say "Go To Definition" for the mfc function, it always shows me the header file. Is this expected behavior? And how does this Go To Definition work? Thanks

+4
source share
6 answers

I would make the small investments needed in Visual Assist . Besides all the great features that it offers, it has an Alt + G command that works better than Visual Studio goes on to define :)

+2
source

External libraries are links to their compiled DLLs, and not to the source when referencing your own projects.

The idea is that you donโ€™t need more than an interface for external classes, but if you want to see the internal DLLs, you can use a tool like Reflector .

+1
source

For the MFC source files (at least for the Feature Pack) I found out in which folder they are located (usually in C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc ) and adds this folder to the " Find Files. "

This is not as straightforward as Go to the definition, and you may have to search among the search results, but it works ...

Note: I am @flippy's second answer from Visual Assist, this is really great.

+1
source

Yes, only interfaces for MFC will be indicated in the header file. If this is not implemented using the template, you will not be able to access the actual definition. The DLL has an implementation for these interfaces.

0
source

Well, if you think about it logically, as far as visual studio knows, the only definition of an MFC object that is available is the definition that it sees in the corresponding MFC header file, so if you donโ€™t actually have the whole source for MFC, they wonโ€™t be able to look somewhere else.

The way intellisense / go to definition works is a file created when the application was compiled. It preserves the mapping between variables / functions and where they are declared (or can be declared in polymorphic situations), and when you right-click to say "go to definition", it refers to this file.

0
source

Yes, this is the expected behavior. Only declarations (header files) of the MFC code are available in your field, and therefore this is the only place you can go to.

What do you expect from him?

0
source

All Articles