How is it possible to find all occurrences of a method if the Visual Studio „Find All References“ does not work?

China☆狼群 提交于 2020-12-07 19:00:49

问题


The special case I am dealing with is to find all usages of the method CTime::Format in the entire solution. Please assume that the Visual Studio functionality „Find All References“ does - as suspected - not work.


回答1:


In order to find all usages of the method CTime::Format follow the steps:

Step 1: Replace the string CTime by the string CCTime in the entire solution.

Step 2: Implement the following:

#include "atltime.h"

class CCTime : public CTime
{
public:
    [[deprecated("--> uses the method CTime::Format")]]
    CString Format(LPCTSTR pszFormat) const
    {
        return CString(_T(" "));
    }
};

Step 3: Rebuild the entire solution in order to get compile errors at the correct spots.



来源:https://stackoverflow.com/questions/65165060/how-is-it-possible-to-find-all-occurrences-of-a-method-if-the-visual-studio-fin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!