HungarianNotation.doc

上传人:hw****26 文档编号:3551444 上传时间:2019-06-04 格式:DOC 页数:2 大小:44KB
下载 相关 举报
HungarianNotation.doc_第1页
第1页 / 共2页
HungarianNotation.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、1Hungarian Notation Basic Order:Prefix-BaseTag-Name-Suffix Prefix: m_ non-static class data members compound s_ static data ( module/function scope ) compound sm_ static class data members compound g_ global variable compound BaseTag: p pointers compound pv pointer to a void argument pp pointer to a

2、 pointerref references compound rg array compound c count of itemsh HANDLE, abstract pointer hr HRESULTb BOOL / bool or other flag bt BYTE (unsigned char)v void ch char/TCHARs short(16 bits) i intl long(32 bits)w WORD (unsigned short) dw DWORD (unsigned long)u any unsigned compound ui UINTul ULONG u

3、s USHORTf float d doublesz CHAR *, string (both null terminated and CString)wsz WCHAR*, Unicode string tsz TCHAR*, Flexible Unicodebstr BSTR/ bstr_t var VARIANT/variant_te enum variable or parametervec vector mat Matrixlst list Suffix:_c constant_t suffix for any type ( including enums)2 Remark.- Co

4、mpound means the prefix or suffix is typically used in combination with additional notations. Combine prefixes in the order .- There is one notable case where Hungarian usually does not add to the readability of code and that is code doing mathematical computations. In this case, simple names such a

5、s x, y, z, i, j, k, etc. can be easier to read and are totally acceptable.Certain abbreviations have become standardabbreviation Wordsrc Sourcedst Destinationrc Rectanglequad Quadrilateralpt Pointtx Textptr Pointerstat Status or statecmd Commandid Identifierwnd Windowbtn Buttonsel Select or Selectio

6、nMember Function NamesWe highly recommend using the following standard prefixes for member function names.Function prefix Type of functionF Query operations that return a boolGet Gets a property.Set or Put Sets a property.CreateDupCreates or duplicates a C+ object. Use “Duplicate” for a method that

7、duplicates the object itself. Objects returned by these functions must be disposed with delete.OnAfterProtected notification methods usually overridden by clients. Where both On and After methods are provided, On is called prior to the event, and After is called after.DrawMoveModifier operations (na

8、med with active verb phrases).Swap Swaps the contents of one object with the contents of another in a way guaranteed to succeed and not throw an exception.For convenience, most useful network addresses and internal websites are listed:Corporate portal site http:/mswMSR Web http:/msrweb/search/mssear

9、ch.aspMSR info web http:/msrinfoInternal Technical Education http:/msteSoftware msrcnxsoftware; bjs-dds-01productsToolbox http:/toolbox/Productivity http:/productivity/Source Depot http:/tools/ToolCenter/SrcDptToolCtr.aspRAID http:/tools/ToolCenter/RaidToolCtr.aspITG web http:/itgweb/Microsoft Public download http:/ http:/

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 精品笔记

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。