... 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
... select the previous pen and brush to the device context. void Cell::Draw(CPoint ptTopLeft, BOOL bEdit, BOOL bMarked, CDC *pDC) { CRect rcCell(ptTopLeft, CSize(COL_WIDTH, ROW_HEIGHT)); CRect ... 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_textColor.In...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 10 ppt
... SetScrollRange(SB_VERT, 0, iPages * PAGE_HEIGHT); CClientDC dc(this); OnPrepareDC(&dc); CRect rcDocument(0, 0, PAGE_WIDTH, iPages * PAGE_HEIGHT); dc.LPtoDP(rcDocument); InvalidateRect(rcDocument); ... 103 RingView.cpp 112, 113 S scroll bar setting 114 serialization 99, 100 RingDoc.cpp 124, 125 set class, MFC class about 137 example 137-140 size class, MFC class CSize class 128 s...
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&...
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 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 6 docx
... 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
Microsoft Visual C++ Windows Applications by Example phần 8 ppsx
... 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 c...
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