... the Application Wizard to generate the classes CCalcApp, CMainFrame, CChildFrame, CCalcDoc, CCalcView, and CAboutDlg. We will modify CCalcDoc and CCalcView as we develop the application, the ... SetPreviousText(CDC* pDC); void Draw(CDC* pDC) const; CRect GetArea() const; Font* GetFont(); void SetFont(const Font& font, CDC* pDC); private: void GenerateCaretArray(CDC* pDC); public:...
Ngày tải lên: 12/08/2014, 21:20
... rcCurrCell.GetRow(), COLS - 1); Chapter 8 [ 293 ] class CCalcDoc : public CDocument { protected: DECLARE_DYNCREATE(CCalcDoc) DECLARE_MESSAGE_MAP() CCalcDoc(); public: virtual void Serialize(CArchive& ... application may have several view objects, but only one document object. CalcView.cpp int CCalcView::OnCreate(LPCREATESTRUCT lpCreateStruct) { // We check that the view has been...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 2 doc
... called every time an object of the class is created. // The default constructor is called for each car object. Car carArray[3]; carArray[2].IncreaseSpeed(100); // The default constructor is called ... "BankAccount.h" BankAccount::BankAccount(int iNumber, double dSaldo /* = 0 */) :m_iNUMBER(iNumber), m_dSaldo(dSaldo) { // Empty. } BankAccount::BankAccount(const BankAccount& b...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 3 pdf
... (Logical Coordinates to Device Coordinates) translates MFC class objects CSize, and CRect, and (one or more) CPoint objects between logical and device coordinates. void DPtoLP(CSize* pSize) const; void ... Type> TemplateStack<Type>::~TemplateStack() { Cell<Type>* pCurrCell = m_pFirstCell; while (pCurrCell != NULL) { Cell<Type>* pRemoveCell = pCurrCell; pCurrCell =...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 4 pptx
... turn calls the Win32 API function DestroyCaret. Caret.cpp void Caret::SetAndShowCaret(const CRect rcCaret) { m_rcCaret = rcCaret; CClientDC dc(m_pFocusView); m_pFocusView->OnPrepareDC(&dc); ... throws an exception. The check_memory macro catches it and aborts the execution with an error message. Check.h #define check_memory(alloc_code) { try { alloc_code; } catch (CExc...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 5 pot
... object is created, is connected to the document object by the pointer m_pTetrisDoc. int CTetrisView::OnCreate(LPCREATESTRUCT lpCreateStruct) { // We check that the view has been correctly created. ... DoubleClick(const CPoint& ptMouse); BOOL Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& szDistance); void Move(const CSize& szDistance); void Draw(C...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 7 pptx
... GetSourceSet. Chapter 8 [ 247 ] Reference.h class Reference { public: Reference(); Reference(int iRow, int iCol); Reference(const Reference& reference); Reference operator=(const Reference& ... ROW_HEIGHT)); CRect rcMargin(rcCell.left + CELL_MARGIN, rcCell.top + CELL_MARGIN, rcCell.right - CELL_MARGIN, rcCell.bottom - CELL_MARGIN); Color penColor = (bEdit || bMarked) ? m_t...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 9 doc
... (isHomeChar(iChar)) { CRect rcChar = m_rectArray[iChar]; CRect rcCaret(rcChar.left, rcChar.top, rcChar.right, rcChar.bottom); return szUpperLeft + rcCaret; } else { CRect rcChar = m_rectArray[iChar ... m_rectArray[iChar - 1]; CRect rcCaret(rcChar.right, rcChar.top, rcChar.right + rcChar.Width(), rcChar.bottom); return szUpperLeft + rcCaret; } } When the user scrolls up and down t...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 10 ppt
... application cell 2 68 cell.cpp 275- 285 cell.h 270-274 CellMatrix.cpp 287 CellMatrix.h 286 CellMatrix class 286 TSetMatrix.cpp 289 -291 TSetMatrix.h 288 TSetMatrix class 287 , 288 square class, tetris application Square.h ... application CDrawView.cpp 234, 236 CDrawView.h 233 view class, MFC application CWordView.cpp 393-4 08 CWordView.h 391 visual studio about 88 , 89 Applicatio...
Ngày tải lên: 12/08/2014, 21:20