Click here to Skip to main content
14,114,975 members
Rate this:
Please Sign up or sign in to vote.
See more:
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.
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 | Cookies | Terms of Service
Web04 | 2.8.190518.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

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