Export (0) Print
Expand All
4 out of 11 rated this helpful - Rate this topic

Defining Keywords in Visual C++

Visual Studio .NET 2003

Keywords are predefined reserved identifiers that have special meanings. They cannot be used as identifiers in your program; however, you can define your own keywords to use in Visual C++, and you can assign customized syntax coloring to the keywords. Syntax coloring gives you visual cues about the structure and state of your code.

To define your own Visual C++ keywords

  1. Using the Visual Studio Code and Text Editor or Windows Notepad, create a text-only file and save it with the name, usertype.dat.
  2. In the file, usertype.dat, type each keyword on a separate line.
  3. Save usertype.dat in the same directory as devenv.exe, as a text-only file.
  4. Exit and restart Visual Studio.
    Note   You cannot rename or reload the usertype.dat file during an editing session because it is read during initialization. All previously defined color settings take precedence as the syntax coloring mechanism checks the usertype.dat file last.
  5. In the Tools Options dialog box, in the Display items box, select User keyword.
  6. Set the font and color properties for the new keywords as described in Fonts and Colors, Environment, Options Dialog Box.

For more information, see C++ Keywords in the C++ Language Reference.

See Also

Customizing the Development Environment | Shortcut Keys

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.