有谁知道CPoint类的代码? 有谁知道CPoint类的代码? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 申明class CPoint : public tagPOINT{public:// Constructors // create an uninitialized point CPoint(); // create from two integers CPoint(int initX, int initY); // create from another point CPoint(POINT initPt); // create from a size CPoint(SIZE initSize); // create from a dword: x = LOWORD(dw) y = HIWORD(dw) CPoint(DWORD dwPoint);// Operations// translate the point void Offset(int xOffset, int yOffset); void Offset(POINT point); void Offset(SIZE size); BOOL operator==(POINT point) const; BOOL operator!=(POINT point) const; void operator+=(SIZE size); void operator-=(SIZE size); void operator+=(POINT point); void operator-=(POINT point);// Operators returning CPoint values CPoint operator+(SIZE size) const; CPoint operator-(SIZE size) const; CPoint operator-() const; CPoint operator+(POINT point) const;// Operators returning CSize values CSize operator-(POINT point) const;// Operators returning CRect values CRect operator+(const RECT* lpRect) const; CRect operator-(const RECT* lpRect) const;}; 源代码在include目录的afxwin1.h不是src目录// CPoint_AFXWIN_INLINE CPoint::CPoint() { /* random filled */ }_AFXWIN_INLINE CPoint::CPoint(int initX, int initY) { x = initX; y = initY; }#if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)_AFXWIN_INLINE CPoint::CPoint(POINT initPt) { *(POINT*)this = initPt; }#endif_AFXWIN_INLINE CPoint::CPoint(SIZE initSize) { *(SIZE*)this = initSize; }_AFXWIN_INLINE CPoint::CPoint(DWORD dwPoint) { x = (short)LOWORD(dwPoint); y = (short)HIWORD(dwPoint); }_AFXWIN_INLINE void CPoint::Offset(int xOffset, int yOffset) { x += xOffset; y += yOffset; }_AFXWIN_INLINE void CPoint::Offset(POINT point) { x += point.x; y += point.y; }_AFXWIN_INLINE void CPoint::Offset(SIZE size) { x += size.cx; y += size.cy; }_AFXWIN_INLINE BOOL CPoint::operator==(POINT point) const { return (x == point.x && y == point.y); }_AFXWIN_INLINE BOOL CPoint::operator!=(POINT point) const { return (x != point.x || y != point.y); }_AFXWIN_INLINE void CPoint::operator+=(SIZE size) { x += size.cx; y += size.cy; }_AFXWIN_INLINE void CPoint::operator-=(SIZE size) { x -= size.cx; y -= size.cy; }_AFXWIN_INLINE void CPoint::operator+=(POINT point) { x += point.x; y += point.y; }_AFXWIN_INLINE void CPoint::operator-=(POINT point) { x -= point.x; y -= point.y; }_AFXWIN_INLINE CPoint CPoint::operator+(SIZE size) const { return CPoint(x + size.cx, y + size.cy); }_AFXWIN_INLINE CPoint CPoint::operator-(SIZE size) const { return CPoint(x - size.cx, y - size.cy); }_AFXWIN_INLINE CPoint CPoint::operator-() const { return CPoint(-x, -y); }_AFXWIN_INLINE CPoint CPoint::operator+(POINT point) const { return CPoint(x + point.x, y + point.y); }_AFXWIN_INLINE CSize CPoint::operator-(POINT point) const { return CSize(x - point.x, y - point.y); }_AFXWIN_INLINE CRect CPoint::operator+(const RECT* lpRect) const { return CRect(lpRect) + *this; }_AFXWIN_INLINE CRect CPoint::operator-(const RECT* lpRect) const { return CRect(lpRect) - *this; } 在vc里面,调用cpoint类的成员函数然后调试的时候跟进去调试,就可以看到成员函数的内容或者在VC7里面,从cpoint类里面派生一个类cmy然后可以看到你这个cmy类的基类的所有成员函数 handsomerun(毛毛)的好方法。想要看MFC什么代码,我们可以定义该对象,然后调试时F11进去。当然,前提是你安装时VC时,要把MFC源代码也安装上去才行。 关于自绘滚动条 关于截包内容的显示 什么是定时器 如何使用定时器 【查看系统中的钩子】 请问如何给组合框添加字符串 新手请教关于界面设计的问题 请问Unicode和编码的转换问题.100分,不成敬意. 我连这些问题都不知道,大家鼓励鼓励!!! 如何在一段cstring的字符串中查找一段关键的字符? ### 我再问一遍 ### 上次会议的讨论不够深入,希望这次会议能有突破性进展 请问Oracle数据库,如果不使用commit时,它会不会自动提交? 系统中有CPoint类,如何自己定义CDPoint类?
class CPoint : public tagPOINT
{
public:
// Constructors // create an uninitialized point
CPoint();
// create from two integers
CPoint(int initX, int initY);
// create from another point
CPoint(POINT initPt);
// create from a size
CPoint(SIZE initSize);
// create from a dword: x = LOWORD(dw) y = HIWORD(dw)
CPoint(DWORD dwPoint);// Operations// translate the point
void Offset(int xOffset, int yOffset);
void Offset(POINT point);
void Offset(SIZE size); BOOL operator==(POINT point) const;
BOOL operator!=(POINT point) const;
void operator+=(SIZE size);
void operator-=(SIZE size);
void operator+=(POINT point);
void operator-=(POINT point);// Operators returning CPoint values
CPoint operator+(SIZE size) const;
CPoint operator-(SIZE size) const;
CPoint operator-() const;
CPoint operator+(POINT point) const;// Operators returning CSize values
CSize operator-(POINT point) const;// Operators returning CRect values
CRect operator+(const RECT* lpRect) const;
CRect operator-(const RECT* lpRect) const;
};
_AFXWIN_INLINE CPoint::CPoint()
{ /* random filled */ }
_AFXWIN_INLINE CPoint::CPoint(int initX, int initY)
{ x = initX; y = initY; }
#if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)
_AFXWIN_INLINE CPoint::CPoint(POINT initPt)
{ *(POINT*)this = initPt; }
#endif
_AFXWIN_INLINE CPoint::CPoint(SIZE initSize)
{ *(SIZE*)this = initSize; }
_AFXWIN_INLINE CPoint::CPoint(DWORD dwPoint)
{
x = (short)LOWORD(dwPoint);
y = (short)HIWORD(dwPoint);
}
_AFXWIN_INLINE void CPoint::Offset(int xOffset, int yOffset)
{ x += xOffset; y += yOffset; }
_AFXWIN_INLINE void CPoint::Offset(POINT point)
{ x += point.x; y += point.y; }
_AFXWIN_INLINE void CPoint::Offset(SIZE size)
{ x += size.cx; y += size.cy; }
_AFXWIN_INLINE BOOL CPoint::operator==(POINT point) const
{ return (x == point.x && y == point.y); }
_AFXWIN_INLINE BOOL CPoint::operator!=(POINT point) const
{ return (x != point.x || y != point.y); }
_AFXWIN_INLINE void CPoint::operator+=(SIZE size)
{ x += size.cx; y += size.cy; }
_AFXWIN_INLINE void CPoint::operator-=(SIZE size)
{ x -= size.cx; y -= size.cy; }
_AFXWIN_INLINE void CPoint::operator+=(POINT point)
{ x += point.x; y += point.y; }
_AFXWIN_INLINE void CPoint::operator-=(POINT point)
{ x -= point.x; y -= point.y; }
_AFXWIN_INLINE CPoint CPoint::operator+(SIZE size) const
{ return CPoint(x + size.cx, y + size.cy); }
_AFXWIN_INLINE CPoint CPoint::operator-(SIZE size) const
{ return CPoint(x - size.cx, y - size.cy); }
_AFXWIN_INLINE CPoint CPoint::operator-() const
{ return CPoint(-x, -y); }
_AFXWIN_INLINE CPoint CPoint::operator+(POINT point) const
{ return CPoint(x + point.x, y + point.y); }
_AFXWIN_INLINE CSize CPoint::operator-(POINT point) const
{ return CSize(x - point.x, y - point.y); }
_AFXWIN_INLINE CRect CPoint::operator+(const RECT* lpRect) const
{ return CRect(lpRect) + *this; }
_AFXWIN_INLINE CRect CPoint::operator-(const RECT* lpRect) const
{ return CRect(lpRect) - *this; }
想要看MFC什么代码,我们可以定义该对象,然后调试时F11进去。
当然,前提是你安装时VC时,要把MFC源代码也安装上去才行。