Common classes
CRect:A class used to represent a rectangle. It has four member variables:Top left bottom right. The tables are the coordinates in the upper left corner and lower right corner. You can construct it using the following methods:
- CRect (intL, IntT, IntR, IntB); Specify four coordinates
- CRect (const RECT &SrcRect); Constructed by RECT Structure
- CRect (LPCRECTLpSrcRect); Constructed by RECT Structure
- CRect (POINTPoint, SIZESize); Coordinates and dimensions are constructed in the upper left corner.
- CRect (POINTTopLeft, POINTBottomRight); Two-point coordinate structure
The following describes several member functions:
- Int Width () const; returns the Width.
- Int Height () const; get the Height
- CSize Size () const; obtain the Size
- CPoint & TopLeft ();
- CPoint & BottomRight ();
- CPoint CenterPoint () const; proper Central Coordinates
In addition, the rectangle can be (CPoint) is used to add the rectangle and the rectangle after the "and" operation is obtained by adding it to the other rectangle.
CPoint:Used to represent the coordinates of a point. There are two member variables:X y. It can be added to another vertex.
CString:A variable-length string. UseCString does not specify the memory size. CString will be allocated as needed. The following describes several member functions:
- Get the string length by GetLength
- Get the character at the specified position by GetAt.
- Operator + is equivalent to strcat