版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Windows風(fēng)格一般情況下,變量的取名方式為: + + 。范圍前綴_,類型前綴_,限定詞。特殊的類型命名,前綴表示: 類、接口前綴 類型 例子 備注 Lm Class LmObject 表示類型本身不與范圍前綴結(jié)合使用 I Interface 接口 IUnknown 注:類名前綴改為Lm,對于非全局的類最好有語義表示其所屬模塊。類的實例命名與類名大致相同,只是類名語義表示類的通用含義,而類名表示此實例的具體語義。如類名LmSketPoint表示草圖點的類定義,而它的兩個實例 _StartPoint,_EndPoint分別代表起點和終點的語義。類的實例命名帶上前綴_。特殊約定:a MouseT
2、ool的派生類的前綴為_Mt.b 對話框類的前綴為CDlg.c 橡皮條類的前綴為_Rb.范圍前綴: 前綴 類型 例子 備注 g_ 全局作用域 g_Servers m_ 成員變量 m_pDoc , l_ 局部作用域 l_strName 少用 注:編程時盡量少用全局變量,對于全局變量還應(yīng)在類型前綴后加上如下關(guān)鍵字:特征模塊 : Fea草圖模塊 : Sket裝配模塊 : Asm工程圖模塊: Lay曲面模塊 : Surf界面模塊 : Ui常用的一般數(shù)據(jù)類型的前綴前綴 類型 內(nèi)存規(guī)格描述 例子 ch char 8-bit character chGrade ch TCHAR 16-bit charact
3、er if _UNICODE is defined chName 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 wPos l LONG 32-bit signed integer lOffset dw DWORD 32-bit unsigned integer dwRange
4、 p * Ambient memory model pointer pDoc lp FAR* Far pointer lpDoc lpsz LPSTR 32-bit pointer to character string 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 h handle Handle to Windows
5、 object hWnd lpfn (*fn)() callbackFar pointer to CALLBACK function lpfnAbort 常用Windows對象名稱縮寫 Windows 對象 例子變量 MFC 類 例子對象 HWND hWnd ; CWnd * pWnd ; HDLG hDlg ; CDialog * pDlg ; HDC hDC ; CDC* pDC ; HGDIOBJ hGdiObj ; CGdiObject * pGdiObj ; HPEN hPen ; CPen * pPen ; HBRUSH hBrush ; CBrush * pBrush ; HFO
6、NT hFont ; CFont * pFont ; HBITMAP hBitmap ; CBitmap * pBitmap ; HPALETTE hPalette ; CPalette * pPalette ; HRGN hRgn ; CRgn * pRgn ; HMENU hMenu ; CMenu * pMenu ; HWND hCtl ; CStatic * pStatic ; HWND hCtl ; CButton * pBtn ; HWND hCtl ; CEdit * pEdit ; HWND hCtl ; CListBox * pListBox ; HWND hCtl ; CC
7、omboBox * pComboBox ; Visual C+常用宏定義命名列表 前綴 符號類型 符號例子 范圍 IDR_ 標識多個資源共享的類型 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_ 圖標資源(Icon) IDI_NOTEPAD 1 to 0x6FFF ID_IDM_ 工具欄或菜單欄的命令項 ID_TO
8、OLS_SPELLING 0x8000 to 0xDFFF HID_ 命令上下文幫助(Command Help context) HID_TOOLS_SPELLING 0x18000 to 0x1DFFF 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 IDC_ 對話框內(nèi)的控制資源(Control) ID
9、C_RECALC 8 to 0xDFFF VISUAL C+ 下的數(shù)據(jù)類型 類型 含義 ATOM Atom. For more information, see Atoms. BOOL Boolean variable (should be TRUE or FALSE). BOOLEAN Boolean variable (should be TRUE or FALSE). BYTE Byte (8 bits). CALLBACK Calling convention for callback functions. CHAR 8-bit Windows (ANSI) character. Fo
10、r more information, see Character Sets Used By Fonts. COLORREF Red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type. CONST Variable whose value is to remain constant during execution. DWORD 32-bit unsigned integer. DWORD_PTR Unsigned long type for pointer precision
11、. 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. ) DWORD32 32-bit unsigned integer. DWORD64 64-bit unsigned integer. FLOAT Floating-point variable. HACCEL Handle to an ac
12、celerator table. HANDLE Handle to an object. 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. HCURSOR Handle to a cursor. HDC Handle to a device context (DC). HDDEDATA Handle to DDE data. HD
13、ESK Handle to a desktop. HDROP Handle to an internal drop structure. HDWP Handle to a deferred window position structure. HENHMETAFILE Handle to an enhanced metafile. HFILE Handle to a file opened by OpenFile, not CreateFile. HFONT Handle to a font. HGDIOBJ Handle to a GDI object. HGLOBAL Handle to
14、a global memory block. HHOOK Handle to a hook. HICON Handle to an icon. HIMAGELIST Handle to an image list. 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. HMENU Handle to a menu. HMETAF
15、ILE Handle to a metafile. HMODULE Handle to a module. The value is the base address of the module. HMONITOR Handle to a display monitor. 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 sta
16、tion. 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. INT32 32-bit signed integer. INT64 64-bit signed integer. LANGID Language identifier. For more information, see Locale
17、s. LCID Locale identifier. For more information, see Locales. 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. LONG32 32-bi
18、t signed integer. LONG64 64-bit signed integer. LONGLONG 64-bit signed integer. LPARAM Message parameter. LPBOOL Pointer to a BOOL. LPBYTE Pointer to a BYTE. LPCOLORREF Pointer to a COLORREF value. LPCRITICAL_SECTION Pointer to a CRITICAL_SECTION. LPCSTR Pointer to a constant null-terminated string
19、of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. LPCTSTR An LPCWSTR if UNICODE is defined, an LPCTSTR otherwise. LPCVOID Pointer to a constant of any type. LPCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more informati
20、on, see Character Sets Used By Fonts. LPDWORD Pointer to a DWORD. LPHANDLE Pointer to a HANDLE. LPINT Pointer to an INT. LPLONG Pointer to a LONG. LPSTR Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. LPTSTR An LPWSTR if
21、 UNICODE is defined, an LPSTR otherwise. LPVOID Pointer to any type. LPWORD Pointer to a WORD. LPWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. LRESULT Signed result of message processing. LUID Locally unique identifier.
22、 PBOOL Pointer to a BOOL. PBOOLEAN Pointer to a BOOL. PBYTE Pointer to a BYTE. PCHAR Pointer to a CHAR. PCRITICAL_SECTION Pointer to a CRITICAL_SECTION. PCSTR Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. PCTS
23、TR A PCWSTR if UNICODE is defined, a PCSTR otherwise. PCWCH Pointer to a constant WCHAR. PCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. PDWORD Pointer to a DWORD. PFLOAT Pointer to a FLOAT. PHANDLE Pointer to
24、a HANDLE. PHKEY Pointer to an HKEY. PINT Pointer to an INT. PLCID Pointer to an LCID. PLONG Pointer to a LONG. PLUID Pointer to a LUID. POINTER_32 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer. POINTER_64 64-bit pointer. On a 64-
25、bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer. PSHORT Pointer to a SHORT. PSTR Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts. PTBYTE Pointer to a TBYTE. PTCHAR Pointer
26、to a TCHAR. PTSTR PWSTR if UNICODE is defined, a PSTR otherwise. PTBYTE Pointer to a TBYTE. PTCHAR Pointer to a TCHAR. PTSTR A PWSTR if UNICODE is defined, a PSTR otherwise. PUCHAR Pointer to a UCHAR. PUINT Pointer to a UINT. PULONG Pointer to a ULONG. PUSHORT Pointer to a USHORT. PVOID Pointer to a
27、ny type. PWCHAR Pointer to a WCHAR. PWORD Pointer to a WORD. PWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts. REGSAM Security access mask for registry key. SC_HANDLE Handle to a service control manager database. For more information, see SCM Handles. SC_LOCK Handle to a service control manager database lock. For more informatio
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度教育培訓(xùn)機構(gòu)履約擔保服務(wù)合同范本4篇
- 2025年度門式起重機租賃合同附帶吊裝作業(yè)安全協(xié)議4篇
- 二零二五年度輪胎行業(yè)綠色認證合同模板4篇
- 二零二五年度店面裝修與室內(nèi)環(huán)境污染治理承包合同4篇
- 2025年度礦山承包采掘勞務(wù)合同(含地質(zhì)勘查)4篇
- 二零二五版智能建筑項目造價管理委托協(xié)議3篇
- 二零二五年度床上用品電商平臺傭金分成合同3篇
- 二零二五年度農(nóng)田農(nóng)業(yè)環(huán)保技術(shù)承包服務(wù)合同4篇
- 2025年度建筑行業(yè)民工勞動合同規(guī)范文本4篇
- 二零二五版煤炭企業(yè)節(jié)能改造合同協(xié)議4篇
- 導(dǎo)尿及留置導(dǎo)尿技術(shù)
- 情人合同范例
- 建筑公司勞務(wù)合作協(xié)議書范本
- 安徽省合肥市2023-2024學(xué)年高一上學(xué)期物理期末試卷(含答案)
- 《基于杜邦分析法的公司盈利能力研究的國內(nèi)外文獻綜述》2700字
- 儒家思想講解課程設(shè)計
- 2024年個人汽車抵押借款合同范本(四篇)
- 2024-2025學(xué)年九年級化學(xué)上冊 第二單元 單元測試卷(人教版)
- 軌道交通設(shè)備更新項目可行性研究報告-超長期國債
- 2024-2030年中國一氧化二氮氣體行業(yè)市場發(fā)展趨勢與前景展望戰(zhàn)略分析報告
- NB/T 11446-2023煤礦連采連充技術(shù)要求
評論
0/150
提交評論