Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ VisualStudio2010
I would like to have certain C/C++ macros show up in the context-sensitive menu displayed while typing in the text editor. Functions and types show up, but macros don't. How can I get a macro similar to the following to show up:
 
#define AreAllBitsClear(value, mask)((value & mask) == 0)
 
I might need a C++ hint file (*.cpp.hint) listing the specific macros I use, but I am unfamilar with such and would need a sample file to get started.
Posted 21-Nov-12 18:40pm
Comments
Mohibur Rashid at 22-Nov-12 1:03am
   
you can create a class with static inline function with template.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Macros are shown in the InteliSense menue by default. I just tested it with VS2008 and a C++ project. If you hit Ctrl+Space in the editor you'll get the list of available namespaces, classes, parameters etc. and also of the defined macros. Of course only those macros are shown that are actually available (included) in the corresponding file.
  Permalink  
Comments
mcrawley at 22-Nov-12 11:09am
   
Legor: That is not the case for me. Namespaces, classes, parameters, methods, and typedefs show up, but not macros. I think they do that so they don't bloat the list with stuff that's used to filter header and source files (ex. __WIN32__, _MSC_VER, _M_IX86, etc.).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 495
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 200
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411028.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100