CRect::operator ==

Determines whether rect is equal to CRect by comparing the coordinates of their upper-left and lower-right corners.

BOOL operator ==( 
   const RECT& rect  
) const throw( );

Параметры

  • rect
    Refers to a source rectangle. Can be a RECT or CRect.

Возвращаемое значение

Nonzero if equal; otherwise 0.

Заметки

ПримечаниеПримечание.

Both of the rectangles must be normalized or this function may fail. You can call NormalizeRect to normalize the rectangles before calling this function.

Пример

CRect rect1(35, 150, 10, 25);
CRect rect2(35, 150, 10, 25);
CRect rect3(98, 999,  6,  3);

ASSERT(rect1 == rect2);

// works just fine against RECTs, as well

RECT test;
test.left = 35;
test.top = 150;
test.right = 10;
test.bottom = 25;

ASSERT(rect1 == test);   

Требования

Header: atltypes.h

См. также

Основные понятия

CRect Class

CRect Members

Hierarchy Chart

CRect::operator !=

CRect::NormalizeRect

EqualRect