www.pudn.com > 0621CAchive.rar > Line.cpp


// Line.cpp: implementation of the CLine class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "0621CAchive.h" 
#include "Line.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
IMPLEMENT_SERIAL(CLine,CObject,1) 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CLine::CLine() 
{ 
} 
 
CLine::CLine(CPoint ptFrom,CPoint ptTo) 
{ 
	m_ptFrom=ptFrom; 
	m_ptTo=ptTo	; 
} 
 
CLine::~CLine() 
{ 
 
} 
 
void CLine::Draw(CDC *pDC) 
{ 
	pDC->MoveTo(m_ptFrom); 
	pDC->LineTo(m_ptTo); 
} 
 
void CLine::Serialize(CArchive &ar) 
{ 
		if (ar.IsStoring()) 
	{ 
		// TODO: add storing code here 
		ar<> m_ptFrom>>m_ptTo; 
	} 
 
}