4

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;

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 ?

James Franco
  • 4,516
  • 10
  • 38
  • 80
  • F12 will go to a definition when the cursor is on the symbol. Does this not work in VS for macros? – Steve Mar 04 '15 at 23:52

1 Answers1

12

my trick is to put

#define __range FOO

in my code, the preprocessor will then say

__range already defined at xxxx.nn
pm100
  • 48,078
  • 23
  • 82
  • 145
  • 1
    Does the "already defined at xxxx.nn" output have to be enabled somehow? It seems with VS2015, it only prints an error "macro redefinition" and "see previous definition of `__range`. Doesn't appear to give you any originating file – bgura Dec 11 '17 at 20:32