版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、Windows風格一般情況下,變量的取名方式為: + + 。范圍前綴_,類型前綴_,限定詞。特殊的類型命名,前綴表示: 類、接口前綴 類型 例子 備注 Lm Class LmObject 表示類型本身不與范圍前綴結合使用 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 少用 注:編程時盡量少用全局變量,對于全局變量還應在類型前綴后加上如下關鍵字:特征模塊 : 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)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 從理論到實踐紀檢監(jiān)察案例管理面試題庫
- 會計職稱考試備考資料與重點難點解析
- 電氣工程師面試題及答案詳解
- 2025年數(shù)字醫(yī)療設備市場拓展項目可行性研究報告
- 2025年城鄉(xiāng)一體化產(chǎn)業(yè)扶貧項目可行性研究報告
- 2025年健康飲品品牌推廣計劃可行性研究報告
- 2025年西南地區(qū)特色農(nóng)產(chǎn)品品牌建設可行性研究報告
- 2025年區(qū)塊鏈在金融行業(yè)應用可行性研究報告
- 2026年河南對外經(jīng)濟貿(mào)易職業(yè)學院單招職業(yè)適應性測試題庫參考答案詳解
- 2026年江西軟件職業(yè)技術大學單招職業(yè)技能測試題庫及參考答案詳解一套
- 2025年杭州市公安局上城區(qū)分局警務輔助人員招聘60人備考題庫及完整答案詳解一套
- 2025國開期末考試《中國現(xiàn)代文學專題》機考試題含答案
- 居民自管小組建設方案
- 2025年煤礦安全生產(chǎn)治本攻堅三年行動工作總結
- 2026年南京交通職業(yè)技術學院單招職業(yè)適應性考試題庫帶答案詳解
- 2025年秋期國家開放大學《理工英語4》期末機考精準復習題庫
- 《勸學》課件+2025-2026學年統(tǒng)編版高一語文必修上冊
- 顱內(nèi)感染指南解讀
- 安全教育教案課程全集
- 飼料生產(chǎn)許可證試題
- 規(guī)培醫(yī)院教學查房規(guī)范教案資料
評論
0/150
提交評論