亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? apf.htm

?? /// //Visual C++ 6.0 21天自學教程
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<P>These lines create three new CPlanetDets type objects and add them to the array.The last line displays the diameter in the TRACE macro without needing to cast thereturned value from myPlanetArray[i] because it's already a pointer of the CPlanetDets*type.</P><P>However, later you might forget the exact nature of myPlanetArray and try to adda CStatic object instead:</P><P><PRE>myPlanetArray.Add(new CStatic());</PRE><P>Fortunately, the compiler will spot the transgression and issue a compiler errorsuch as</P><P><PRE>`Add' : cannot convert parameter 1 from `class &Acirc;CStatic *' to `class CPlanetDets *</PRE><P>However, the error wouldn't have been spotted if you had been using a CObArrayto hold the planet details:</P><P><PRE>CObArray myPlanetArray;</PRE><P>The CStatic object would be happily stored along with the CPlanetDets objects,causing untold havoc when you try to retrieve the CStatic object, thinking it's aCPlanetDets object.</P><P>The template used to generate type-safe lists is CList; it takes the same generalform as CArray:</P><P><PRE>CList&lt;CMyCustomClass*, CMyCustomClass *&gt; myCustomClassList;</PRE><P>Again, the first parameter is the required returned object type, and the secondparameter specifies the accepted object types for functions that accept elementsfor storage.</P><P>All the functions available for lists are available for your own specific type-safecustomized lists, again checking and returning your specified types. Therefore, theequivalent list-based code for the planet storing array would be coded like this:</P><P><PRE>CList&lt;CPlanetDets*,CPlanetDets*&gt; myPlanetList;myPlanetList.AddTail(new CPlanetDets  &Acirc;(4878, 0.054, 57.91, 87.969));myPlanetList.AddTail(new CPlanetDets  &Acirc;(12100, 0.815, 108.21, 224.701));myPlanetList.AddTail(new CPlanetDets  &Acirc;(12756, 1.000, 149.60, 365.256));POSITION pos = myPlanetList.GetHeadPosition();while(pos) TRACE(&quot;Diameter = %f\n&quot;,myPlanetList.</PRE><H3><A NAME="Heading5"></A>&Acirc;GetNext(pos)-&gt;m_dDiameter);</H3><P>The template for customized maps differs from the list and arrays in that it needsfour parameters: an input and a return value for both the key and element value.So the general form is like this:</P><P><PRE>CMap&lt;MyType, MyArgType, CMyCustomClass *, CMyCustomClassArg *&gt;myCustomClassMap;</PRE><P>The first parameter, MyType, specifies the internally stored key value for eachmap association. This can be any of the basic types such as int, WORD, DWORD, double,float, or CString, or it can be a pointer to your own specific type.</P><P>The second parameter, MyArgType, specifies the argument type used to pass keyvalues in and out of the map functions.</P><P>The third parameter, CMyCustomClass *, is how you want the internal element valuesto be stored (as specific type-safe pointers to your objects).</P><P>The fourth parameter, CMyCustomClassArg *, specifies the argument type used topass your element values in and out of the map functions. For example, to associatethe planet details with their names, you might code the following:</P><P><PRE>CMap&lt;CString,LPCSTR,CPlanetDets*,CPlanetDets*&gt; myPlanetMap;myPlanetMap.SetAt(&quot;Mercury&quot;,          new CPlanetDets(4878, 0.054, 57.91, 87.969));myPlanetMap.SetAt(&quot;Venus&quot;,          new CPlanetDets(12100, 0.815, 108.21, 224.701));myPlanetMap.SetAt(&quot;Earth&quot;,          new CPlanetDets(12756, 1.000, 149.60, 365.256));CPlanetDets* pPlanet = NULL;if (myPlanetMap.Lookup(&quot;Venus&quot;,pPlanet))TRACE(&quot;Diameter = %f\n&quot;,pPlanet-&gt;m_dDiameter);</PRE><P>The map declaration indicates that the objects should be stored internally asCStrings but use LPCSTR (pointers to constant character arrays) to pass values intoand out of the map. The planet's details themselves will be both stored internallyand accessed as pointers to CPlanetDets objects (such as CPlanetDets*).</P><BLOCKQUOTE>	<P><HR><B>POTENTIAL PROBLEMS WHEN USING THE MAP'S INTERNAL HASH KEY TYPES</B></P>	<P>You must be wary of the conversion between the passed parameters and the internal	hash key storage system. For example, if you were to replace the CString in the previous	example with another LPCSTR for the internal storage object, the Lookup() would fail	to find &quot;Venus&quot; because it would be comparing the pointer values (to different	instances of &quot;Venus&quot;) rather than the contents of the strings. <HR></BLOCKQUOTE><H2><A NAME="Heading6"></A>Using the Coordinate-Handling Classes</H2><P>Because Windows is a graphically oriented environment, you'll often need to holdpoint positions, rectangles, and sizes. Three MFC classes help store and manipulatethese coordinates: CPoint, CRect, and CSize. Each has several member functions andoperator overloads that take much of the work out of adding, constructing, and findingderivatives of these coordinates.</P><P>Also several of the MFC and GDI functions understand their types or underlyingtypes as parameter values, so you don't have to perform any messy mangling operationsto pass them into functions.</P><P><H3><A NAME="Heading7"></A>Using the CPoint Class</H3><P>CPoint encapsulates a POINT structure that just holds an x and y position to representa point on a two-dimensional surface. You can always access x and y members directlyto get or set their current values like this:</P><P><PRE>CPoint ptOne;ptOne.x = 5;ptOne.y = 20;TRACE(&quot;Co-ordinate = (%d,%d)\n&quot;,ptOne.x,ptOne.y);</PRE><P>You set these values when you construct a CPoint object by passing values to oneof CPoint's several constructors, as shown in Table F.4.</P><P><H4>TABLE F.4.&nbsp;CONSTRUCTOR TYPES FOR THE CPoint CLASS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Constructor Definition</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CPoint()</TD>		<TD ALIGN="LEFT">Constructs an uninitialized object</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CPoint(POINT ptInit)</TD>		<TD ALIGN="LEFT">Copies the settings from a POINT structure or another CPoint object</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CPoint(int x, int y)</TD>		<TD ALIGN="LEFT">Initializes the object from the x and y parameter values</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CPoint(DWORD dwInit)</TD>		<TD ALIGN="LEFT">Uses the low 16 bits for the x value and the high 16 bits for the y value</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CPoint(SIZE sizeInit)</TD>		<TD ALIGN="LEFT">Copies the settings from a SIZE structure or CSize object</TD>	</TR></TABLE></P><P>For example, you could replace the last sample lines with these for the same result:</P><P><PRE>CPoint ptOne(5,20);TRACE(&quot;Co-ordinate = (%d,%d)\n&quot;,ptOne.x,ptOne.y);</PRE><P>One of the most useful aspects of the CPoint class is its many operator overloads.By using the +, -, +=, and -= operators with other CPoint, CRect, or CSize objects,you can add or subtract coordinate pairs from other coordinate pairs or from rectanglesor sizes. For example, the long way to subtract two points from each other to givea third would be like this:</P><P><PRE>CPoint ptOne(5,20);CPoint ptTwo(25,40);CPoint ptThree;ptThree.x = ptTwo.x - ptOne.x;ptThree.y = ptTwo.y - ptOne.y;</PRE><P>This can be simplified by using the operator overload:</P><P><PRE>CPoint ptOne(5,20);CPoint ptTwo(25,40);CPoint ptThree = ptTwo - ptOne;</PRE><P>Or you can add the coordinates of one point to another like this:</P><P><PRE>ptTwo += ptOne;</PRE><P>You can also use the == and != logical operator overloads to perform comparisons.For example, to check whether ptTwo is equal to ptOne in both x and y values, youcan code the following:</P><P><PRE>if (ptOne == ptTwo) TRACE(&quot;Points are the same&quot;);</PRE><P>There is also an Offset() function that adds an offset value specified by passingx and y values, or a CPoint class or POINT structure, or a CSize or SIZE structure.Therefore, the following two lines are functionally identical:</P><P><PRE>ptOne.Offset(75,-15);ptOne-=CPoint(-75,15);</PRE><H3><A NAME="Heading8"></A>Using the CRect Class</H3><P>The CRect class encapsulates a RECT structure to hold two pairs of coordinatesthat describe a rectangle by its top-left point and its bottom-right point. You canconstruct a CRect object using one of its several constructors, as shown in TableF.5.</P><P><H4>TABLE F.5.&nbsp;CONSTRUCTOR TYPES FOR THE CRect CLASS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Constructor Definition</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect()</TD>		<TD ALIGN="LEFT">Constructs an uninitialized object</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect(const RECT&amp; rcInit)</TD>		<TD ALIGN="LEFT">Copies the settings from another RECT structure or CRect object</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect(LPCRECT lprcInit)</TD>		<TD ALIGN="LEFT">Copies the settings via a RECT or CRect pointer</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect(int l,int t,int r,int b)</TD>		<TD ALIGN="LEFT">Initializes the coordinates from left, top, right, and bottom parameters</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect(POINT point, SIZE size)</TD>		<TD ALIGN="LEFT">Initializes from a POINT or CPoint and a SIZE or CSize</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CRect(POINT ptTL, POINT ptBR)</TD>		<TD ALIGN="LEFT">Initializes from a top-left POINT and a bottom-right POINT</TD>	</TR></TABLE></P><P>After you've constructed a CRect object, you can access each of the top, left,bottom, and right members individually using the (LPRECT) cast to cast it into aRECT structure as shown in these lines:</P><P><PRE>CRect rcOne(15,15,25,20); ((LPRECT)rcOne)-&gt;bottom += 20;TRACE(&quot;Rect is (%d,%d)-(%d,%d)&quot;,((LPRECT)rcOne)-&gt;left,((LPRECT)rcOne)-&gt;top,        ((LPRECT)rcOne)-&gt;right,((LPRECT)rcOne)-&gt;bottom);</PRE><P>Alternatively, you can access the members via either the top-left CPoint or thebottom-right CPoint. References to these member objects are returned by the TopLeft()and BottomRight() functions. When you've accessed either the top-left or bottom-rightpoints, you can then manipulate them using any of the CPoint functions shown in theprevious section. For example, the following lines are functionally identical tothe previous lines, but differ in that they construct and access the rectangle usingCPoint objects:</P><P><PRE>CRect rcOne(CPoint(15,15),CPoint(25,20));rcOne.BottomRight().y += 20;TRACE(&quot;Rect is (%d,%d)-(%d,%d)&quot;,    rcOne.TopLeft().x,rcOne.TopLeft().y,    rcOne.BottomRight().x,rcOne.BottomRight().y);</PRE><P>You can also use the SetRect() function to set the coordinates by passing fourintegers to represent the top-left x- and y-coordinates and the bottom-right x- andy-coordinates. SetRectEmpty() sets all these coordinates to zero to make a NULL rectangle.The IsRectNull() function will return TRUE if called on such a NULL rectangle, andIsRectEmpty() will return TRUE if the width and height are both zero (even if theindividual values are not zero).</P><P>Several helper functions help you calculate various aspects of the rectangle'sgeometry. The width and height can be found by calling the Width()and Height() functions,each of which returns the relevant integer value. Alternatively, you can find a CSizethat represents both width and height by calling the Size() function. For example,the following line displays the width and height of the rectangle rcOne:</P><P><PRE>TRACE(&quot;Rect Width = %d, Height = %d\n&quot;,                     rcOne.Width(), rcOne.Height());</PRE><P>The point in the center of the rectangle is often a useful coordinate to know;you can find this by calling the CenterPoint() function, which returns a CPoint objectto represent the center of the rectangle.</P><P>You might use this to find the center of your window's client area and draw adot there like this:</P><P><PRE>CRect rcClient;GetClientRect(&amp;rcClient);dc.SetPixel(rcClient.CenterPoint(),0);</PRE><P>You can also find the union or intersection of two rectangles by calling UnionRect()and InterSectRect(), which both take two source rectangles as parameters and setthe coordinates of the calling CRect object to the union or intersection. The unionis the smallest rectangle that will enclose the two source rectangles. The intersectionis the largest rectangle that is enclosed by both source rectangles. The diagramin Figure F.1 shows the union and intersection of two source rectangles labeled Aand B.</P><P><A HREF="javascript:popUp('33fig01.gif')"><B>FIGURE F.1.</B></A><B> </B><I>Theunion and intersection between two rectangles.</I></P><P>The following lines calculate the intersection and union of the source rectanglesrcOne and rcTwo:</P><P><PRE>CRect rcOne(10,10,100,100);CRect rcTwo(50,50,150,200);CRect rcUnion, rcIntersect;rcUnion.UnionRect(rcOne,rcTwo);rcIntersect.IntersectRect(rcOne,rcTwo);</PRE><P>When this code is run, rcUnion will be set to coordinates (10,10)-(150,200) andrcIntersect will be set to coordinates (50,50)-(100,100).</P><P>You can use SubtractRect() to find the subtraction of one rectangle from another.This is the smallest rectangle that contains all the points not intersected by thetwo source rectangles (or the smallest non-overlapping section). For example, byadding the following lines to an OnPaint() handler, you can see the effects of SubtractRect()to subtract rcTwo from rcOne to produce rcDst. The resulting subtraction is the sectionthat will be drawn in blue at the bottom of the diagram, as shown in Figure F.2.</P><P><PRE>CRect rcOne(10,10,220,220), rcTwo(50,50,150,260), rcDst;rcDst.SubtractRect(rcTwo,rcOne);dc.FillSolidRect(rcOne,RGB(255,0,0));//reddc.FillSolidRect(rcTwo,RGB(0,255,0));//greendc.FillSolidRect(rcDst,RGB(0,0,255));//blue

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美不卡一区二区三区四区| 亚洲国产欧美日韩另类综合| 亚洲夂夂婷婷色拍ww47| 亚洲国产精品一区二区久久| 国产精品一品二品| 欧美日韩视频一区二区| 亚洲精品亚洲人成人网在线播放| 蜜臀91精品一区二区三区 | 99视频热这里只有精品免费| 4438x成人网最大色成网站| 国产精品久久久久久亚洲毛片| 首页国产丝袜综合| 欧美综合久久久| 亚洲欧洲av在线| 国产一区二区三区四| 在线播放91灌醉迷j高跟美女| 亚洲乱码一区二区三区在线观看| 成人亚洲一区二区一| 精品国内二区三区| 青青草成人在线观看| 欧美剧情电影在线观看完整版免费励志电影| 国产视频一区二区三区在线观看| 五月激情综合色| 欧美日韩中文字幕精品| 依依成人精品视频| 99国产精品久久久久久久久久| 国产精品天干天干在线综合| 国产成人精品午夜视频免费| 久久久久久麻豆| 国产高清成人在线| 精品成人免费观看| 国产自产视频一区二区三区| 久久伊人中文字幕| 日韩精品每日更新| 日韩你懂的电影在线观看| 日韩精品一卡二卡三卡四卡无卡| 欧美日韩国产区一| 日本强好片久久久久久aaa| 3751色影院一区二区三区| 日韩成人伦理电影在线观看| 日韩无一区二区| 激情六月婷婷综合| 中文字幕欧美激情一区| 99久久777色| 亚洲综合色视频| 777亚洲妇女| 精品亚洲欧美一区| 欧美国产日韩在线观看| 99视频一区二区三区| 亚洲福利一二三区| 91精品国产欧美一区二区18 | 一区二区日韩av| 欧美色综合久久| 麻豆精品新av中文字幕| 国产欧美日韩卡一| 色综合 综合色| 午夜久久电影网| 欧美精品一区二区三区久久久| 国产福利91精品一区| 国产精品免费免费| 色美美综合视频| 久久99精品国产.久久久久久| 久久久久成人黄色影片| 国产成人av电影在线| 亚洲六月丁香色婷婷综合久久 | 日本不卡免费在线视频| 欧美极品美女视频| 欧美日韩在线不卡| 国产精品一二三| 亚洲123区在线观看| 久久精品欧美一区二区三区麻豆| 色先锋久久av资源部| 久久爱www久久做| 亚洲精品免费播放| 久久只精品国产| 欧美日韩免费在线视频| 高清免费成人av| 日韩成人免费电影| 亚洲色图欧洲色图| 精品国产污污免费网站入口 | 亚洲成人先锋电影| 欧美激情在线一区二区三区| 欧美另类高清zo欧美| 91网站在线观看视频| 狠狠色伊人亚洲综合成人| 亚洲最大的成人av| 国产精品女上位| 久久香蕉国产线看观看99| 欧美色图12p| gogogo免费视频观看亚洲一| 久久草av在线| 午夜一区二区三区在线观看| 国产精品色哟哟网站| xnxx国产精品| 欧美一区二区三区免费| 成人午夜精品在线| 国产成人免费在线| 狠狠狠色丁香婷婷综合激情| 亚洲国产一区二区a毛片| 亚洲欧美日韩久久| 中文字幕一区二区三区不卡在线| 久久男人中文字幕资源站| 欧美三级在线播放| 91丝袜美女网| 成人午夜激情视频| 成人午夜在线免费| 成人综合婷婷国产精品久久| 激情综合五月婷婷| 丝袜诱惑制服诱惑色一区在线观看| 一区二区三区波多野结衣在线观看| 亚洲天堂av一区| 亚洲猫色日本管| 亚洲区小说区图片区qvod| 国产精品乱人伦| 国产精品乱子久久久久| 国产精品污网站| 国产精品免费久久久久| 国产精品的网站| 亚洲精品久久7777| 亚洲一区二区三区影院| 亚洲国产精品一区二区久久 | 成人一区二区三区中文字幕| 成人小视频免费在线观看| 91在线观看成人| 91丝袜国产在线播放| 欧美午夜在线一二页| 91精品国产一区二区三区| 日韩写真欧美这视频| 久久午夜老司机| |精品福利一区二区三区| 一区二区三区欧美日韩| 午夜亚洲福利老司机| 六月丁香婷婷色狠狠久久| 国产精品123| a在线播放不卡| 欧美日韩的一区二区| 精品99999| 亚洲色图视频网| 青青草精品视频| 不卡一二三区首页| 欧美日韩卡一卡二| 久久精品日产第一区二区三区高清版| 国产精品乱人伦| 偷窥国产亚洲免费视频| 国产精品99久久久久久久女警 | 国产成人一级电影| 色94色欧美sute亚洲13| 日韩亚洲欧美一区二区三区| 中文字幕av在线一区二区三区| 一区二区三区资源| 青草国产精品久久久久久| 不卡av在线网| 91精品国产综合久久香蕉麻豆| 久久久av毛片精品| 五月天亚洲婷婷| 99在线精品视频| 日韩视频免费直播| 伊人婷婷欧美激情| 国产成人免费视频精品含羞草妖精| 欧美色区777第一页| 国产精品人人做人人爽人人添| 视频一区二区中文字幕| 波多野结衣在线一区| 日韩亚洲欧美一区| 一区二区三区四区乱视频| 国产一区二区导航在线播放| 在线电影一区二区三区| 综合在线观看色| 国产精品一区二区免费不卡| 91精品国产入口| 亚洲一区二区在线视频| 粉嫩aⅴ一区二区三区四区| 在线不卡a资源高清| 亚洲欧美日本韩国| 国产99久久久国产精品| 精品久久久久久久久久久久久久久 | 一本大道久久a久久精品综合| 久久婷婷成人综合色| 日韩精品免费视频人成| 欧美色图一区二区三区| 国产精品成人一区二区艾草| 国产一区二区伦理片| 日韩精品综合一本久道在线视频| 亚洲国产日韩av| 99久久婷婷国产综合精品电影 | 日韩高清不卡一区| 欧美日韩第一区日日骚| 亚洲综合一区在线| 一本到一区二区三区| 国产精品国产精品国产专区不蜜| 国产精品一级黄| 亚洲国产成人午夜在线一区| 国产成人av电影在线观看| 久久久久久久综合| 国产成人av一区二区三区在线| 久久久久久毛片| 成人精品高清在线| 国产精品久久一级| 91亚洲精品久久久蜜桃| 尤物视频一区二区|