匈牙利命名法则

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
HMENU
Handle to a menu.
HMETAFILE
Handle to a metafile.
HMODULE
Handle to a module. The value is the base address of the module.
HMONITOR
Handle to a display monitor.
LONG32
32-bit signed integer.
LONG64
64-bit signed integer.
LONGLONG
64-bit signed integer.
LPARAM
Message parameter.
LPBOOL
Pointer to aBOOL.
LPBYTE
Pointer to aBYTE.
匈牙利命名法规则大全
一般情况下,变量的取名方式为:
<scope_> + <prefix_> + <qualifier>。
范围前缀_,类型前缀_,限定词。
特殊的类型命名,前缀表示:
类、接口
前缀
类型
例子
备注
Lm
Class
LmObject
表示类型本身
不与范围前缀结合使用
I
Interfaceቤተ መጻሕፍቲ ባይዱ口
IUnknown
注:类名前缀改为Lm,对于非全局的类最好有语义表示其所属模块。类的实例命名与类名大致相同,只是类名语义表示类的通用含义,而类名表示此实例的具体语义。如类名LmSketPoint表示草图点的类定义,而它的两个实例_StartPoint,_EndPoint分别代表起点和终点的语义。类的实例命名带上前缀_。
DWORD
32-bit unsigned integer.
DWORD_PTR
Unsigned long type for pointer precision. Use when casting a pointer to a long type to perform pointer arithmetic. (Also commonly used for general 32-bit parameters that have been extended to 64 bits in 64-bit Windows. )
HPALETTE
Handle to a palette.
HPEN
Handle to a pen.
HRGN
Handle to a region.
HRSRC
Handle to a resource.
HSZ
Handle to a DDE string.
HWINSTA
Handle to a window station.
LCTYPE
Locale information type. For a list, see Locale and Language Information.
LONG
32-bit signed integer.
LONG_PTR
Signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic.
INT32
32-bit signed integer.
INT64
64-bit signed integer.
LANGID
Language identifier. For more information, see Locales.
LCID
Locale identifier. For more information, see Locales.
IDR_MAINFRAME
1 to 0x6FFF
IDD_
对话框资源(Dialog)
IDD_SPELL_CHECK
1 to 0x6FFF
IDB_
位图资源(Bitmap)
IDB_COMPANY_LOGO
1 to 0x6FFF
IDC_
光标资源(Cursor)
IDC_PENCIL
1 to 0x6FFF
IDI_
pFont ;
HBITMAP
hBitmap ;
CBitmap *
pBitmap ;
HPALETTE
hPalette ;
CPalette *
pPalette ;
HRGN
hRgn ;
CRgn *
pRgn ;
HMENU
hMenu ;
CMenu *
pMenu ;
HWND
hCtl ;
CStatic *
pStatic ;
h
handle
Handle to Windows object
hWnd
lpfn
(*fn)()
callbackFar pointer to CALLBACK function
lpfnAbort
常用Windows对象名称缩写
Windows对象
例子变量
MFC类
例子对象
HWND
hWnd ;
CWnd *
pWnd ;
DWORD32
32-bit unsigned integer.
DWORD64
64-bit unsigned integer.
FLOAT
Floating-point variable.
HACCEL
Handle to an accelerator table.
HANDLE
Handle to an object.
b
BOOL
Boolean value
bEnabled
n
int
Integer (size dependent on operating system)
nLength
n
UINT
Unsigned value (size dependent on operating system)
nLength
w
WORD
16-bit unsigned value
Handle to a font.
HGDIOBJ
Handle to a GDI object.
HGLOBAL
Handle to a global memory block.
HHOOK
Handle to a hook.
HICON
Handle to an icon.
HIMAGELIST
Handle to an image list.
lpszName
lpsz
LPCSTR
32-bit pointer to constant character string
lpszName
lpsz
LPCTSTR
32-bit pointer to constant character string if _UNICODE is defined
lpszName
HWND
hCtl ;
CButton *
pBtn ;
HWND
hCtl ;
CEdit *
pEdit ;
HWND
hCtl ;
CListBox *
pListBox ;
HWND
hCtl ;
CComboBox *
pComboBox ;
Visual C++常用宏定义命名列表
前缀
符号类型
符号例子
范围
IDR_
标识多个资源共享的类型
特殊约定:
a.MouseTool的派生类的前缀为_Mt.
b.对话框类的前缀为CDlg.
c.橡皮条类的前缀为_Rb.
范围前缀:
前缀
类型
例子
备注
g_
全局作用域
g_Servers
m_
成员变量
m_pDoc ,
l_
局部作用域
l_strName
少用
注:编程时尽量少用全局变量,对于全局变量还应在类型前缀后加上如下关键字:
BOOLEAN
Boolean variable (should be TRUE or FALSE).
BYTE
Byte (8 bits).
CALLBACK
Calling convention for callback functions.
CHAR
8-bit Windows (ANSI) character. For more information, see Character Sets Used By Fonts.
IDP_
消息框提示文字资源
IDP_INVALID_PARTNO
8 to 0xDFFF
HIDP_
消息框上下文帮助(Message-box Help context)
HIDP_INVALID_PARTNO
0x30008 to 0x3DFFF
IDS_
字符串资源(String)
IDS_COPYRIGHT
1 to 0x7FFF
HWND
Handle to a window.
INT
32-bit signed integer.
INT_PTR
Signed integral type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
IDC_
对话框内的控制资源(Control)
IDC_RECALC
8 to 0xDFFF
VISUAL C++下的数据类型
类型
含义
ATOM
Atom. For more information, see Atoms.
BOOL
Boolean variable (should be TRUE or FALSE).
HDWP
Handle to a deferred window position structure.
HENHMETAFILE
Handle to an enhanced metafile.
HFILE
Handle to a file opened byOpenFile, notCreateFile.
HFONT
HIMC
Handle to input context.
HINSTANCE
Handle to an instance.
HKEY
Handle to a registry key.
HKL
Input locale identifier.
HLOCAL
Handle to a local memory block.
LPCOLORREF
Pointer to aCOLORREFvalue.
LPCRITICAL_SECTION
Pointer to aCRITICAL_SECTION.
HDLG
hDlg ;
CDialog *
pDlg ;
HDC
hDC ;
CDC*
pDC ;
HGDIOBJ
hGdiObj ;
CGdiObject *
pGdiObj ;
HPEN
hPen ;
CPen *
pPen ;
HBRUSH
hBrush ;
CBrush *
pBrush ;
HFONT
hFont ;
CFont *
图标资源(Icon)
IDI_NOTEPAD
1 to 0x6FFF
ID_IDM_
工具栏或菜单栏的命令项
ID_TOOLS_SPELLING
0x8000 to 0xDFFF
HID_
命令上下文帮助(Command Help context)
HID_TOOLS_SPELLING
0x18000 to 0x1DFFF
HBITMAP
Handle to a bitmap.
HBRUSH
Handle to a brush.
HCONV
Handle to a dynamic data exchange (DDE) conversation.
HCONVLIST
Handle to a DDE conversation list.
COLORREF
Red, green, blue (RGB) color value (32 bits). SeeCOLORREFfor information on this type.
CONST
Variable whose value is to remain constant during execution.
特征模块:Fea
草图模块:Sket
装配模块:Asm
工程图模块:Lay
曲面模块:Surf
界面模块:Ui
常用的一般数据类型的前缀
前缀
类型
内存规格描述
例子
ch
char
8-bit character
chGrade
ch
TCHAR
16-bit character if _UNICODE is defined
chName
HCURSOR
Handle to a cursor.
HDC
Handle to a device context (DC).
HDDEDATA
Handle to DDE data.
HDESK
Handle to a desktop.
HDROP
Handle to an internal drop structure.
wPos
l
LONG
32-bit signed integer
lOffset
dw
DWORD
32-bit unsigned integer
dwRange
p
*
Ambient memory model pointer
pDoc
lp
FAR*
Far pointer
lpDoc
lpsz
LPSTR
32-bit pointer to character string
相关文档
最新文档