第一種--使用mfc.bsc源瀏覽器檔案
mfc.bsc是可以查看MFC原始碼的檔案,其位置在MFC原始碼檔案夾下,Visual Studio版本不一樣的話,位置也不一樣。
vc6.0位置:C:/Program Files/Microsoft Visual Studio/VC98/MFC/SRC/
vc2008sp1位置:D:/Program Files/Microsoft Visual Studio 9.0/VC/atlmfc/src/mfc
類似的位置搜尋下就可以找得到,MSDN上有三種方法添加.bsc檔案到工程,如下原文:
To open the .bsc file
* On the File menu, click Open and open the .bsc file.
The .bsc file will be available to all projects in the solution until you either reload the solution or delete the .bsc file from Solution Explorer or the Object Browser.
To attach the .bsc file to your project
1.In Solution Explorer, right-click the project node and click Add Existing Item on the shortcut menu.
2.Browse to the .bsc file and add it to your project.
The .bsc file will only be available in the project to which it is added. You can save the project so that the .bsc file will be available the next time that you open the project. You can delete the .bsc file from Solution Explorer
To add the .bsc file to the Object Browser
*In the Object Browser, click the Customize button and browse to the desired .bsc file.
When you add .bsc files to the Object Browser with the Customize button, the files are available to all projects in any solution that you open. This setting will persist across Visual Studio sessions.
The .bsc file that is referenced in each method will then appear in the Object Browser.
這裡介紹第三種方法,單擊“視圖”→“物件瀏覽器”,在彈出的“物件瀏覽器”面板上“瀏覽”→“編輯自訂群組件集”→“瀏覽”→“檔案類型”→“源瀏覽器檔案(*.bsc)”,然後在MFC原始碼檔案夾下選擇mfc.bsc→“添加”→“確定”,步驟如所示。
結果如所示。
此時,假如我們要查看某一個函數的話,在“搜尋”框輸入如:cdialog 斷行符號,就會在左邊看到查詢到的類資訊,右邊是類成員函數和變數,在右邊可以按下想要搜尋的函數開頭字母,快速定位到以那字母開頭的函數,然後右鍵想要查看的函數或變數選擇“轉到定義”,就會跳轉到原始碼處,如所示。
彈出的原始碼定義,如所示。
第二種--使用VAX尋找原始碼
VAX是Visual Studio外掛程式,VC開發人員很多使用到它,它也可以查看原始碼。在工具列上左起第三個”Find Symbol“,如所示。
在彈出的對話方塊,先勾掉”Show only symbols defined in current solution",然後輸入要檢索的類或函數等等,如所示。
結果也是定位到原始碼上,如所示。
http://blog.csdn.net/akof1314/article/details/6084683