Click here to Skip to main content
11,930,069 members (48,520 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ VS2010
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
Mohibur Rashid 22-Nov-12 1:03am
you can create a class with static inline function with template.

1 solution

Rate this: bad
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.
mcrawley 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2015
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