![C++編程的Windows風(fēng)格_第1頁(yè)](http://file1.renrendoc.com/fileroot_temp2/2020-9/29/9278b3ae-a2d3-4a15-b48e-a8677fa3b599/9278b3ae-a2d3-4a15-b48e-a8677fa3b5991.gif)
![C++編程的Windows風(fēng)格_第2頁(yè)](http://file1.renrendoc.com/fileroot_temp2/2020-9/29/9278b3ae-a2d3-4a15-b48e-a8677fa3b599/9278b3ae-a2d3-4a15-b48e-a8677fa3b5992.gif)
![C++編程的Windows風(fēng)格_第3頁(yè)](http://file1.renrendoc.com/fileroot_temp2/2020-9/29/9278b3ae-a2d3-4a15-b48e-a8677fa3b599/9278b3ae-a2d3-4a15-b48e-a8677fa3b5993.gif)
![C++編程的Windows風(fēng)格_第4頁(yè)](http://file1.renrendoc.com/fileroot_temp2/2020-9/29/9278b3ae-a2d3-4a15-b48e-a8677fa3b599/9278b3ae-a2d3-4a15-b48e-a8677fa3b5994.gif)
![C++編程的Windows風(fēng)格_第5頁(yè)](http://file1.renrendoc.com/fileroot_temp2/2020-9/29/9278b3ae-a2d3-4a15-b48e-a8677fa3b599/9278b3ae-a2d3-4a15-b48e-a8677fa3b5995.gif)
版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Windows風(fēng)格一般情況下,變量的取名方式為: + + 。范圍前綴_,類(lèi)型前綴_,限定詞。特殊的類(lèi)型命名,前綴表示: 類(lèi)、接口前綴 類(lèi)型 例子 備注 Lm Class LmObject 表示類(lèi)型本身不與范圍前綴結(jié)合使用 I Interface 接口 IUnknown 注:類(lèi)名前綴改為L(zhǎng)m,對(duì)于非全局的類(lèi)最好有語(yǔ)義表示其所屬模塊。類(lèi)的實(shí)例命名與類(lèi)名大致相同,只是類(lèi)名語(yǔ)義表示類(lèi)的通用含義,而類(lèi)名表示此實(shí)例的具體語(yǔ)義。如類(lèi)名LmSketPoint表示草圖點(diǎn)的類(lèi)定義,而它的兩個(gè)實(shí)例 _StartPoint,_EndPoint分別代表起點(diǎn)和終點(diǎn)的語(yǔ)義。類(lèi)的實(shí)例命名帶上前綴_。特殊約定:a MouseT
2、ool的派生類(lèi)的前綴為_(kāi)Mt.b 對(duì)話框類(lèi)的前綴為CDlg.c 橡皮條類(lèi)的前綴為_(kāi)Rb.范圍前綴: 前綴 類(lèi)型 例子 備注 g_ 全局作用域 g_Servers m_ 成員變量 m_pDoc , l_ 局部作用域 l_strName 少用 注:編程時(shí)盡量少用全局變量,對(duì)于全局變量還應(yīng)在類(lèi)型前綴后加上如下關(guān)鍵字:特征模塊 : Fea草圖模塊 : Sket裝配模塊 : Asm工程圖模塊: Lay曲面模塊 : Surf界面模塊 : Ui常用的一般數(shù)據(jù)類(lèi)型的前綴前綴 類(lèi)型 內(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對(duì)象名稱(chēng)縮寫(xiě) Windows 對(duì)象 例子變量 MFC 類(lèi) 例子對(duì)象 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+常用宏定義命名列表 前綴 符號(hào)類(lèi)型 符號(hào)例子 范圍 IDR_ 標(biāo)識(shí)多個(gè)資源共享的類(lèi)型 IDR_MAINFRAME 1 to 0x6FFF IDD_ 對(duì)話框資源(Dialog) IDD_SPELL_CHECK 1 to 0x6FFF IDB_ 位圖資源(Bitmap) IDB_COMPANY_LOGO 1 to 0x6FFF IDC_ 光標(biāo)資源(Cursor) IDC_PENCIL 1 to 0x6FFF IDI_ 圖標(biāo)資源(Icon) IDI_NOTEPAD 1 to 0x6FFF ID_IDM_ 工具欄或菜單欄的命令項(xiàng) 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_ 對(duì)話框內(nèi)的控制資源(Control) ID
9、C_RECALC 8 to 0xDFFF VISUAL C+ 下的數(shù)據(jù)類(lèi)型 類(lèi)型 含義 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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025糧油銷(xiāo)售合同范本
- 打字員的勞動(dòng)合同書(shū)
- 印刷品訂貨合同格式
- 2025房屋商用租賃合同范本
- 2025農(nóng)機(jī)社會(huì)化服務(wù)作業(yè)合同(合同版本)
- 醫(yī)療機(jī)構(gòu)采購(gòu)與供應(yīng)合同
- 配音演員聘用合同范本
- 探索在線技能培訓(xùn)的新模式
- 指點(diǎn)迷津筑夢(mèng)未來(lái)主題班會(huì)
- 技術(shù)進(jìn)口合同范本
- 六年級(jí)上冊(cè)數(shù)學(xué)書(shū)蘇教版答案
- 2023年全國(guó)中小學(xué)思政課教師網(wǎng)絡(luò)培訓(xùn)研修總結(jié)心得體會(huì)
- CDE網(wǎng)站申請(qǐng)人之窗欄目介紹及用戶(hù)操作手冊(cè)
- 車(chē)班班長(zhǎng)工作總結(jié)5篇
- 行業(yè)會(huì)計(jì)比較(第三版)PPT完整全套教學(xué)課件
- 值機(jī)業(yè)務(wù)與行李運(yùn)輸實(shí)務(wù)(第3版)高職PPT完整全套教學(xué)課件
- 高考英語(yǔ)語(yǔ)法填空專(zhuān)項(xiàng)訓(xùn)練(含解析)
- 42式太極劍劍譜及動(dòng)作說(shuō)明(吳阿敏)
- 部編版語(yǔ)文小學(xué)五年級(jí)下冊(cè)第一單元集體備課(教材解讀)
- 仁愛(ài)英語(yǔ)九年級(jí)下冊(cè)單詞表(中英文)
- 危險(xiǎn)化學(xué)品企業(yè)安全生產(chǎn)標(biāo)準(zhǔn)化課件
評(píng)論
0/150
提交評(píng)論