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 (int l, int T, int R, int B); Specify four coordinates
Crect (const rect & srcrect); constructed by rect Structure
Crect (lpcrect lpsrcrect); constructed by rect Structure
Crect (point, size); coordinate and Size Structure in the upper left corner
Crect (point topleft, point bottomright); 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 added to the cpoint for displacement, and the rectangle after the "and" operation is obtained by adding the rectangle to the other.
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. Use cstring to 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
Void format (lpctstr lpszformat,...); equivalent to sprintf
Find to find the specified character, string
Compare comparison
Comparenocase case-insensitive comparison
Change makeupper to lower case
Change makelower to uppercase
Cstringarray: a variable-length string array. Each element in the array is an instance of the cstring object.
The following describes several member functions:
Add cstring
Removeat deletes the cstring object at the specified position
Removeall deletes all cstring objects in the array.
Get the cstring object at the specified position through getat.
Setat: modifies the cstring object at the specified position.
Insertat inserts a cstring object at a certain position
Common macros
RGB
Trace
Assert
Verify
Common functions
Cwindapp * afxgetapp ();
Hinstance AfxGetInstanceHandle ();
Hinstance afxgetresourcehandle ();
Int afxmessagebox (lpctstr lpsztext, uint ntype = mb_ OK, uint nidhelp = 0); used to pop up a message box