CRect myRect(0, 0, 100, 200); // creates a rectangle at (0,0) with width 100 and height 200 CSize mySize(50, 100); // create a size with width 50 and height 100 myRect.Size = mySize; // set the size of the rectangle to our new size (50,100)
CRect myRect(0, 0, 100, 200); // creates a rectangle at (0,0) with width 100 and height 200 int width = myRect.Size.cx; // gets the width (100) int height = myRect.Size.cy; // gets the height (200)The package library used in these examples is MFC (Microsoft Foundation Class).