CRect rect; rect.SetRect(0, 0, 100, 50);
CRect rect; int left = 10, top = 20, right = 80, bottom = 70; rect.SetRect(left, top, right, bottom);This code creates a CRect object named rect and sets its left, top, right and bottom coordinates using the variables left, top, right and bottom respectively. Package library: MFC (Microsoft Foundation Class)