Share via


CSize::CSize

Constructs a CSize object.

CSize( ) throw( ); 
CSize( 
   int initCX, 
   int initCY  
) throw( );
CSize( 
   SIZE initSize  
) throw( );
CSize( 
   POINT initPt  
) throw( );
CSize( 
   DWORD dwSize  
) throw( );

Parameters

  • initCX
    Sets the cx member for the CSize.

  • initCY
    Sets the cy member for the CSize.

  • initSize
    SIZE structure or CSize object used to initialize CSize.

  • initPt
    POINT structure or CPoint object used to initialize CSize.

  • dwSize
    DWORD used to initialize CSize. The low-order word is the cx member and the high-order word is the cy member.

Remarks

If no arguments are given, cx and cy members are not initialized.

Example

CSize szEmpty;
CSize szPointA(10, 25);

SIZE sz;
sz.cx = 10;
sz.cy = 25;
CSize szPointB(sz);

POINT pt;
pt.x = 10;
pt.y = 25;
CSize szPointC(pt);

CPoint ptObject(10, 25);
CSize szPointD(ptObject);   

DWORD dw = MAKELONG(10, 25);
CSize szPointE(dw);

ASSERT(szPointA == szPointB);
ASSERT(szPointB == szPointC);
ASSERT(szPointC == szPointD);
ASSERT(szPointD == szPointE);   

Requirements

Header: atltypes.h

See Also

Reference

CSize Class

Hierarchy Chart

Other Resources

CSize Members