如何知道某个宏在Visual Studio中定义的位置 [英] How to know where a certain macro is defined in Visual Studio

查看:94
本文介绍了如何知道某个宏在Visual Studio中定义的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个使用DirectX的Visual Studio项目.代码中有一些宏,例如

I currently have a visual studio project that uses DirectX. There are some macros in the code such as

__range(0, m_lBatchSize)  LONG  m_nBatched;
__field_ecount_opt(m_lBatchSize) IMediaSample  **      m_ppSamples;

我想知道这些宏在哪些文件中定义.通常在Visual Studio中,我将单击goto定义,然后转到definitio.在这种情况下,它不会带我到任何地方.该功能对宏有效吗?有什么办法让我找出在何处定义此宏?

I wanted to know which files these macros are defined in. Normally in Visual Studio I would click goto definition and it would take me to the definitio. It is not taking me anywhere in this case. Does that feature work for macros ? Is there any way for me to find out where this macro is defined ?

推荐答案

我的诀窍是

#define __range FOO

在我的代码中,预处理器会说

in my code, the preprocessor will then say

__range already defined at xxxx.nn

这篇关于如何知道某个宏在Visual Studio中定义的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆