Compartilhar via


CPoint Class

Similar to the Windows POINT structure.

class CPoint : public tagPOINT

Members

Public Constructors

Name

Description

CPoint::CPoint

Constructs a CPoint.

Public Methods

Name

Description

CPoint::Offset

Adds values to the x and y members of the CPoint.

Public Operators

Name

Description

CPoint::operator -

Returns the difference of a CPoint and a size, or the negation of a point, or the size difference between two points, or the offset by a negative size.

CPoint::operator !=

Checks for inequality between two points.

CPoint::operator +

Returns the sum of a CPoint and a size or point, or a CRect offset by a size.

CPoint::operator +=

Offsets CPoint by adding a size or point.

CPoint::operator -=

Offsets CPoint by subtracting a size or point.

CPoint::operator ==

Checks for equality between two points.

Remarks

It also includes member functions to manipulate CPoint and POINT structures.

A CPoint object can be used wherever a POINT structure is used. The operators of this class that interact with a "size" accept either CSize objects or SIZE structures, since the two are interchangeable.

Note

This class is derived from the tagPOINT structure. (The name tagPOINT is a less commonly used name for the POINT structure.) This means that the data members of the POINT structure, x and y, are accessible data members of CPoint.

Note

For more information on shared utility classes (like CPoint), see Shared Classes.

Inheritance Hierarchy

tagPOINT

CPoint

Requirements

Header: atltypes.h

See Also

Reference

Hierarchy Chart

POINT Structure

CRect Class

CSize Class

Concepts

MFC Sample MDI