user152508
user152508

Reputation: 3131

Visual Studio Go to Definition

Go To definition in Visual studio 2005 works only for files that are in my project. It never works for files that are included in external libraries like mfc. When I say Go To Definition for mfc function it always shows me the header file . Is this expected behavior? And also how does this whole thing Go To Definition work? Thanks

Upvotes: 4

Views: 4636

Answers (6)

JaredPar
JaredPar

Reputation: 754595

Yes this is the expected behavior. Only the declarations (header files) of the MFC code are available on your box and hence that is the only location that it can take you to.

What are you expecting it to show?

Upvotes: 0

Chris
Chris

Reputation: 376

External libraries are references to their compiled DLLs rather than the source when referencing your own projects.

The idea is that you don't need any more than the interface to external classes, but, if you would like to see the internals of DLLs you can use a tool such as Reflector.

Upvotes: 0

djeidot
djeidot

Reputation: 4642

For the MFC source files (at least the Feature Pack ones) I learned to find out what folder are they in (usually at C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc) and add that folder to the Find in Files dialog.

It's not as direct as Go to Definition, and you may have to browse among the find results, but it works...

Note: I second @flippy's answer of Visual Assist, it's really great.

Upvotes: 1

Flawe
Flawe

Reputation:

I'd make the small investment required in Visual Assist. Besides all the great features it offers, it has the Alt+G command which works way better than the Visual Studio go to definition :)

Upvotes: 2

MBillock
MBillock

Reputation: 220

Well if you think about it logically, as far as visual studio knows the only definition of the MFC object that is available is the definition it sees in the associated MFC header file, so unless you actually have the entire source for MFC it won't be able to look anywhere else.

The way that intellisense/go to definition works is via a file that is created when you compile the application. It stores a mapping between variables/functions and where they are declared (or could potentially be declared, in polymorphic situations), and when you right click to say "go to definition" it references that file.

Upvotes: 0

yesraaj
yesraaj

Reputation: 47900

Yes only the interfaces for MFC will be given in header file.Unless it is implemented with Template you will not be able to access the actual definition.The dlls have implementation for those interfaces.

Upvotes: 0

Related Questions