Partager via


MFC Predefined Symbols

 

The latest version of this topic can be found at MFC Predefined Symbols.

MFC projects always include several header files that support windows. These are added via #include statements in the StdAfx.h file:

#include <afxwin.h>      //MFC core and standard components  
#include <afxext.h>      //MFC extensions  
#include <afxdisp.h      //MFC automation classes  
#include <afxdtctl.h>   //MFC support for Internet Explorer common controls  
#include <afxcmn.h>      //MFC support for Windows common controls.  

The header files include symbol ID values for MFC common values. These symbols are only available when you are working in an MFC project. Note that the AFX_ prefix is followed by the standard symbol name prefixes.

AFX_ID_PREVIEW_CLOSE
AFX_ID_PREVIEW_NEXT AFX_ID_PREVIEW_NUMPAGE
AFX_ID_PREVIEW_PREV AFX_ID_PREVIEW_PRINT
AFX_ID_PREVIEW_ZOOMIN AFX_ID_PREVIEW_ZOOMOUT
AFX_IDB_CHECKLISTBOX_95 AFX_IDB_MINIFRAME_MENU
AFX_IDC_BROWSE AFX_IDC_BROWSER
AFX_IDC_CHANGE AFX_IDC_CLEAR
AFX_IDC_COLOR_BLACK AFX_IDC_COLOR_BLUE
AFX_IDC_COLOR_CYAN AFX_IDC_COLOR_DARKBLUE
AFX_IDC_COLOR_DARKCYAN AFX_IDC_COLOR_DARKGREEN
AFX_IDC_COLOR_DARKMAGENTA AFX_IDC_COLOR_DARKRED
AFX_IDC_COLOR_GRAY AFX_IDC_COLOR_GREEN
AFX_IDC_COLOR_LIGHTBROWN AFX_IDC_COLOR_LIGHTGRAY
AFX_IDC_COLOR_MAGENTA AFX_IDC_COLOR_RED
AFX_IDC_COLOR_WHITE AFX_IDC_COLOR_YELLOW
AFX_IDC_COLORPROP AFX_IDC_CONTEXTHELP
AFX_IDC_FONTNAMES AFX_IDC_FONTPROP
AFX_IDC_FONTSIZES AFX_IDC_FONTSTYLES
AFX_IDC_HSPLITBAR AFX_IDC_LISTBOX
AFX_IDC_MAGNIFY AFX_IDC_MOUSE_MASK
AFX_IDC_MOUSE_ORG_HORZ AFX_IDC_MOUSE_ORG_HV
AFX_IDC_MOUSE_ORG_VERT AFX_IDC_MOUSE_PAN_E
AFX_IDC_MOUSE_PAN_HORZ AFX_IDC_MOUSE_PAN_HV
AFX_IDC_MOUSE_PAN_N AFX_IDC_MOUSE_PAN_NE
AFX_IDC_MOUSE_PAN_NW AFX_IDC_MOUSE_PAN_S
AFX_IDC_MOUSE_PAN_SE AFX_IDC_MOUSE_PAN_SW
AFX_IDC_MOUSE_PAN_VERT AFX_IDC_MOUSE_PAN_W
AFX_IDC_MOVE4WAY AFX_IDC_NODROPCRSR
AFX_IDC_PICTURE AFX_IDC_PRINT_DOCNAME
AFX_IDC_PRINT_PAGENUM AFX_IDC_PRINT_PORTNAME
AFX_IDC_PRINT_PRINTERNAME AFX_IDC_PROPNAME
AFX_IDC_SAMPLEBOX AFX_IDC_SMALLARROWS
AFX_IDC_STRIKEOUT AFX_IDC_SYSTEMCOLORS
AFX_IDC_TAB_CONTROL AFX_IDC_TRACK4WAY
AFX_IDC_TRACKNESW AFX_IDC_TRACKNS
AFX_IDC_TRACKNWSE AFX_IDC_TRACKWE
AFX_IDC_UNDERLINE AFX_IDC_VSPLITBAR
AFX_IDD_BUSY AFX_IDD_CHANGEICON
AFX_IDD_CHANGESOURCE AFX_IDD_CONVERT
AFX_IDD_EDITLINKS AFX_IDD_FILEBROWSE
AFX_IDD_INSERTOBJECT AFX_IDD_NEWTYPEDLG
AFX_IDD_OBJECTPROPERTIES AFX_IDD_PASTESPECIAL
AFX_IDD_PREVIEW_TOOLBAR AFX_IDD_PRINTDLG
AFX_IDD_PROPPAGE_COLOR AFX_IDD_PROPPAGE_FONT
AFX_IDD_PROPPAGE_PICTURE AFX_IDI_STD_FRAME
AFX_IDI_STD_MDIFRAME AFX_IDP_ARCH_BADCLASS
AFX_IDP_ARCH_BADINDEX AFX_IDP_ARCH_BADSCHEMA
AFX_IDP_ARCH_ENDOFFILE AFX_IDP_ARCH_GENERIC
AFX_IDP_ARCH_NONE AFX_IDP_ARCH_READONLY
AFX_IDP_ARCH_WRITEONLY AFX_IDP_ASK_TO_DISCARD
AFX_IDP_ASK_TO_SAVE AFX_IDP_ASK_TO_UPDATE
AFX_IDP_BAD_VERB AFX_IDP_COMMAND_FAILURE
AFX_IDP_DAO_BADBINDINFO AFX_IDP_DAO_COLUMNUNAVAILABLE
AFX_IDP_DAO_DFX_BIND AFX_IDP_DAO_ENGINE_ INITIALIZATION
AFX_IDP_DAO_OBJECT_NOT_OPEN AFX_IDP_DAO_ROWTOOSHORT
AFX_IDP_DLL_BAD_VERSION AFX_IDP_DLL_LOAD_FAILED
AFX_IDP_E_BADFILEMODE AFX_IDP_E_BADFILENAME
AFX_IDP_E_ BADFILENAMEORNUMBER AFX_IDP_E_BADRECORDLENGTH
AFX_IDP_E_BADREDORDNUMBER AFX_IDP_E_CANTSAVEFILETOEMP
AFX_IDP_E_DEVICEIOERROR AFX_IDP_E_DEVICEUNAVAILABLE
AFX_IDP_E_DISKFULL AFX_IDP_E_DISKNOTREADY
AFX_IDP_E_DIVISIONBYZERO AFX_IDP_E_FILEALREADYEXISTS
AFX_IDP_E_FILEALREADYOPEN AFX_IDP_E_FILENOTFOUND
AFX_IDP_E_GETNOTSUPPORTED AFX_IDP_E_ GETNOTSUPPORTEDATRUNTIME
AFX_IDP_E_ILLEGALFUNCTIONCALL AFX_IDP_E_ INVALIDCLIPBOARDFORMAT
AFX_IDP_E_INVALIDFILEFORMAT AFX_IDP_E_INVALIDPATTERNSTRING
AFX_IDP_E_INVALIDPICTURE AFX_IDP_E_ INVALIDPROPERTYARRAYINDEX
AFX_IDP_E_INVALIDPROPERTYVALUE AFX_IDP_E_INVALIDUSEOFNULL
AFX_IDP_E_ NEEDPROPERTYARRAYINDEX AFX_IDP_E_OUTOFMEMORY
AFX_IDP_E_OUTOFSTACKSPACE AFX_IDP_E_OVERFLOW
AFX_IDP_E_PATHFILEACCESSERROR AFX_IDP_E_PATHNOTTFOUND
AFX_IDP_E_PERMISSIONDENIED AFX_IDP_E_PRINTERERROR
AFX_IDP_E_PROPERTYNOTFOUND AFX_IDP_E_REPLACEMENTSTOOLONG
AFX_IDP_E_SEARCHTEXTNOTFOUND AFX_IDP_E_SETNOTPERMITTED
AFX_IDP_E_SETNOTSUPPORTED AFX_IDP_E_ SETNOTSUPPORTEDATRUNTIME
AFX_IDP_E_TOOMANYFILES AFX_IDP_FAILED_ACCESS_READ
AFX_IDP_FAILED_ACCESS_WRITE AFX_IDP_FAILED_DISK_FULL
AFX_IDP_FAILED_INVALID_FORMAT AFX_IDP_FAILED_INVALID_PATH
AFX_IDP_FAILED_IO_ERROR_READ AFX_IDP_FAILED_IO_ERROR_WRITE
AFX_IDP_FAILED_MAPI_LOAD AFX_IDP_FAILED_MAPI_SEND
AFX_IDP_FAILED_MEMORY_ALLOC AFX_IDP_FAILED_TO_AUTO_REGISTER
AFX_IDP_FAILED_TO_CONNECT AFX_IDP_FAILED_TO_CONVERT
AFX_IDP_FAILED_TO_CREATE AFX_IDP_FAILED_TO_CREATE_DOC
AFX_IDP_FAILED_TO_LAUNCH AFX_IDP_FAILED_TO_LAUNCH_HELP
AFX_IDP_FAILED_TO_NOTIFY AFX_IDP_FAILED_TO_OPEN_DOC
AFX_IDP_FAILED_TO_REGISTER AFX_IDP_FAILED_TO_SAVE_DOC
AFX_IDP_FAILED_TO_START_PRINT AFX_IDP_FAILED_TO_UPDATE
AFX_IDP_FILE_ACCESS_DENIED AFX_IDP_FILE_BAD_PATH
AFX_IDP_FILE_BAD_SEEK AFX_IDP_FILE_DIR_FULL
AFX_IDP_FILE_DISKFULL AFX_IDP_FILE_EOF
AFX_IDP_FILE_GENERIC AFX_IDP_FILE_HARD_IO
AFX_IDP_FILE_INVALID_FILE AFX_IDP_FILE_LOCKING
AFX_IDP_FILE_NONE AFX_IDP_FILE_NOT_FOUND
AFX_IDP_FILE_REMOVE_CURRENT AFX_IDP_FILE_SHARING
AFX_IDP_FILE_TOO_LARGE AFX_IDP_FILE_TOO_MANY_OPEN
AFX_IDP_GET_NOT_SUPPORTED AFX_IDP_INTERNAL_FAILURE
AFX_IDP_INVALID_FILENAME AFX_IDP_INVALID_MAPI_DLL
AFX_IDP_NO_ERROR_AVAILABLE AFX_IDP_PARSE_BYTE
AFX_IDP_PARSE_CURRENCY AFX_IDP_PARSE_DATE
AFX_IDP_PARSE_DATETIME AFX_IDP_PARSE_GUID
AFX_IDP_PARSE_INT AFX_IDP_PARSE_INT_RANGE
AFX_IDP_PARSE_RADIO_BUTTON AFX_IDP_PARSE_REAL
AFX_IDP_PARSE_REAL_RANGE AFX_IDP_PARSE_STRING_SIZE
AFX_IDP_PARSE_TIME AFX_IDP_PARSE_UINT
AFX_IDP_PICTURECANTLOAD AFX_IDP_PICTURECANTOPEN
AFX_IDP_PICTUREREADFAILED AFX_IDP_PICTURETOOLARGE
AFX_IDP_SCRIPT_ DISPATCH_EXCEPTION AFX_IDP_SCRIPT_ERROR
AFX_IDP_SERVER_BUSY AFX_IDP_SET_NOT_SUPPORTED
AFX_IDP_STATIC_OBJECT AFX_IDP_UNREG_DONE
AFX_IDP_UNREG_FAILURE AFX_IDR_PREVIEW_ACCEL
AFX_IDS_ACTIVATE_VERB AFX_IDS_ALL_FILES
AFX_IDS_ALLFILTER AFX_IDS_APP_TITLE
AFX_IDS_APP_TITLE_EMBEDDING AFX_IDS_AUTO
AFX_IDS_AUTOSAVE_RECOVERED AFX_IDS_AUTOSAVE_RECOVERY_ASK_1
AFX_IDS_AUTOSAVE_RECOVERY_ASK_2 AFX_IDS_AUTOSAVE_RECOVERY_ASK_3
AFX_IDS_AUTOSAVE_RECOVERY_ASK_4 AFX_IDS_AUTOSAVE_RECOVERY_ASK_5
AFX_IDS_AUTOSAVE_RECOVERY_ASK_6 AFX_IDS_BITMAP_FORMAT
AFX_IDS_BOLD AFX_IDS_BOLDITALIC
AFX_IDS_BORDERSTYLE_0 AFX_IDS_BORDERSTYLE_1
AFX_IDS_CHANGE_LINK AFX_IDS_CHECKLISTBOX_CHECK
AFX_IDS_CHECKLISTBOX_MIXED AFX_IDS_CHECKLISTBOX_ UNCHECK
AFX_IDS_COLOR_ACTIVEBAR AFX_IDS_COLOR_ACTIVEBORDER
AFX_IDS_COLOR_ACTIVETEXT AFX_IDS_COLOR_APPWORKSPACE
AFX_IDS_COLOR_BTNFACE AFX_IDS_COLOR_BTNHIGHLIGHT
AFX_IDS_COLOR_BTNSHADOW AFX_IDS_COLOR_BTNTEXT
AFX_IDS_COLOR_DESKTOP AFX_IDS_COLOR_DISABLEDTEXT
AFX_IDS_COLOR_HIGHLIGHT AFX_IDS_COLOR_HIGHTLIGHTTEXT
AFX_IDS_COLOR_INACTIVEBAR AFX_IDS_COLOR_INACTIVEBORDER
AFX_IDS_COLOR_INACTIVETEXT AFX_IDS_COLOR_MENUBAR
AFX_IDS_COLOR_MENUTEXT AFX_IDS_COLOR_PPG
AFX_IDS_COLOR_PPG_CAPTION AFX_IDS_COLOR_SCROLLBARS
AFX_IDS_COLOR_WNDBACKGND AFX_IDS_COLOR_WNDFRAME
AFX_IDS_COLOR_WNDTEXT AFX_IDS_COMPANY_NAME
AFX_IDS_DELETED AFX_IDS_DESKACCESSORY
AFX_IDS_DISPLAYSTRING_COLOR AFX_IDS_DISPLAYSTRING_FONT
AFX_IDS_DISPLAYSTRING_PICTURE AFX_IDS_EDIT_VERB
AFX_IDS_EMBED_FORMAT AFX_IDS_EXIT_MENU
AFX_IDS_FONT_PPG AFX_IDS_FONT_PPG_CAPTION
AFX_IDS_FROZEN AFX_IDS_HELPMODEMESSAGE
AFX_IDS_HIDE AFX_IDS_HTTP_AUTH_REQUIRED
AFX_IDS_HTTP_BAD_REQUEST AFX_IDS_HTTP_FORBIDDEN
AFX_IDS_HTTP_NO_TEXT AFX_IDS_HTTP_NOT_FOUND
AFX_IDS_HTTP_NOT_IMPLEMENTED AFX_IDS_HTTP_SERVER_ERROR
AFX_IDS_HTTP_TITLE AFX_IDS_IDLEMESSAGE
AFX_IDS_INVALID_CURRENCY AFX_IDS_INVALID_DATETIME
AFX_IDS_INVALID_DATETIMESPAN AFX_IDS_ITALIC
AFX_IDS_LINKSOURCE_FORMAT AFX_IDS_MANUAL
AFX_IDS_MDICHILD AFX_IDS_MEMORY_EXCEPTION
AFX_IDS_METAFILE_FORMAT AFX_IDS_MINI-FONT
AFX_IDS_NOT_DOCOBJECT AFX_IDS_NOT_SUPPORTED_ EXCEPTION
AFX_IDS_OBJ_TITLE_INPLACE AFX_IDS_OBJECT_MENUITEM
AFX_IDS_OCC_SCALEUNITS_PIXELS AFX_IDS_ONEPAGE
AFX_IDS_OPENFILE AFX_IDS_PASTELINKEDTYPE
AFX_IDS_PICTURE_PPG AFX_IDS_PICTURE_PPG_CAPTION
AFX_IDS_PICTUREBROWSETITLE AFX_IDS_PICTUREFILTER
AFX_IDS_PICTYPE_BITMAP AFX_IDS_PICTYPE_ICON
AFX_IDS_PICTYPE_METAFILE AFX_IDS_PICTYPE_NONE
AFX_IDS_PICTYPE_UNKNOWN AFX_IDS_PREVIEW_CLOSE
AFX_IDS_PREVIEWPAGEDESC AFX_IDS_PRINTCAPTION
AFX_IDS_PRINTDEFAULT AFX_IDS_PRINTDEFAULTEXT
AFX_IDS_PRINTFILTER AFX_IDS_PRINTONPORT
AFX_IDS_PRINTPAGENUM AFX_IDS_PRINTTOFILE
AFX_IDS_PROPPAGE_UNKNOWN AFX_IDS_REGULAR
AFX_IDS_RESOURCE_EXCEPTION AFX_IDS_RTF_FORMAT
AFX_IDS_SAMPLETEXT AFX_IDS_SAVE_AS_MENU
AFX_IDS_SAVE_COPY_AS_MENU AFX_IDS_SAVE_MENU
AFX_IDS_SAVEFILE AFX_IDS_SAVEFILECOPY
AFX_IDS_SCCLOSE AFX_IDS_SCMAXIMIZE
AFX_IDS_SCMINIMIZE AFX_IDS_SCMOVE
AFX_IDS_SCNEXTWINDOW AFX_IDS_SCPREVWINDOW
AFX_IDS_SCRESTORE AFX_IDS_SCSIZE
AFX_IDS_SCTASKLIST AFX_IDS_STATUS_FONT
AFX_IDS_TEXT_FORMAT AFX_IDS_TOOLTIP_FONT
AFX_IDS_TWOPAGE AFX_IDS_UNICODE_FONT
AFX_IDS_UNKNOWNTYPE AFX_IDS_UNNAMED_FILE
AFX_IDS_UNTITLED AFX_IDS_UPDATE_MENU
AFX_IDS_UPDATING_ITEMS AFX_IDS_USER_EXCEPTION
AFX_IDS_VERB_EDIT AFX_IDS_VERB_PROPERTIES

Requirements

MFC

See Also

Predefined Symbol IDs
Symbols: Resource Identifiers