⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myobject.cpp

📁 实现撤销和恢复功能得远吗
💻 CPP
字号:
// MyObject.cpp: implementation of the CMyObject class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TestUndo.h"
#include "MyObject.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMyObject::CMyObject(CRect rect)
{
	m_rect = rect;
	m_nRef = 0;
}

CMyObject::~CMyObject()
{

}

void CMyObject::Draw( CDC * pDC )
{
	pDC->Rectangle( m_rect );
}

void CMyObject::AddRef( )
{
	m_nRef ++;
}

void CMyObject::Release( )
{
	m_nRef --;

	if( m_nRef == 0 )
		delete this;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -