Microsoft Visual C++ Windows Applications by Example phần 9 doc
... (m_stText.IsEmpty()) Chapter 9 [ 363 ] enum WordState {WS_EDIT, WS_MARK}; typedef CArray<Page> PageArray; class CWordDoc : public CDocument { private: DECLARE_DYNCREATE(CWordDoc) DECLARE_MESSAGE_MAP() CWordDoc(); ... m_psLastMark; Font *m_pNextFont; }; CWordDoc must have a default constructor because it will be created dynamically by the Application Framework. CWordDoc.cpp CW...
Ngày tải lên: 12/08/2014, 21:20
... iNum2 = 9, int iNum3 = 99 ) { return iNum1 + iNum2 + iNum3; } void main() { cout << Add(1) << endl; // 1 + 9 + 99 = 1 09 cout << Add(1, 2) << endl; // 1 + 2 + 99 = 102 ... the example below, all three calls are legitimate. In the rst call, iNum2 and iNum3 will be given the values 9 and 99 , respectively; in the second call, iNum3 will be given the val...
Ngày tải lên: 12/08/2014, 21:20
... CreateFigure(iId); } } The Document Class CDrawDoc is the document class. Its task is to accept mouse and keyboard input from the CDrawView view objects, to manage the document's data, to ... handle scroll movements. Its only eld m_pDrawDoc is a pointer to the document class object. It is initialized by OnCreate. DrawView.h class CDrawDoc; class CDrawView: public CScrollView { pri...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 3 pdf
... function by sending the message from the view to the document. RingView.cpp void CRingView::OnLButtonDown(UINT nFlags, CPoint point) { CRingDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDoc->MouseDown(point); ... can save and load document data by the means of Serialization. • • • • • • • Chapter 3 [ 89 ] When the rst version of MFC was released, there was no standard logical...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 4 pptx
... purpose. RingDoc.h static const int RADIUS = 500; class CRingDoc : public CDocument { // }; RingView.cpp void CRingView::OnDraw(CDC* pDC) { CRingDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); ... this book, it is used to check the document class object in the view class of each application. CRingDoc* pDoc = GetDocument(); check(pDoc != NULL); ASSERT_VALID(pDoc); If we run out of dynam...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 5 pot
... Draw Application Document as File type long name. This implies that we can start the application in Windows Explorer by choosing the application, or by choosing one of the documents (a le ... (CView::OnCreate(lpCreateStruct) == -1) { return -1; } m_pTetrisDoc = (CTetrisDoc*) m_pDocument; check(m_pTetrisDoc != NULL); ASSERT_VALID(m_pTetrisDoc); return 0; } The Tetris Applicatio...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 7 pptx
... EOL VALUE(1)* Expression + Expression EOL 9 9 9 VALUE(1)* VALUE(2) + Expression EOL VALUE(1)* VALUE(2) + VALUE(3) EOL The derivation can be illustrated by the development of a parse tree. Formula Expression EOL Formula Expression Expression ... a different order. 9 VALUE(1)* VALUE(2) + Expression EOL VALUE(1)* VALUE(2) + VALUE(3) EOL Expression* Expression + Expression EOL VALUE(1) E...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 8 ppsx
... } } The Document/View Model This application supports the Document/View model. CCalcDoc is the document class and CCalcView is the view class. The Document Class The class CCalcDoc is generated by ... cells one by one. We start by dening a test cell matrix and a test target set matrix, which are copies of the document elds m_cellMatrix and m_tSetMatrix. Then we paste the cells one...
Ngày tải lên: 12/08/2014, 21:20
Microsoft Visual C++ Windows Applications by Example phần 10 ppt
... application CWordView.cpp 393 -408 CWordView.h 391 visual studio about 88, 89 Application Wizard 88 W windows development coordinate system 93 , 94 cursor 98 device context 94 -98 message system 90 registry 98 serialization ... 117 RingDoc.cpp 118 RingDoc.h 117 message map 90 message system 90 -93 methods 50 metric system 93 MFC 88, 89 MFC application wizard about 104-1...
Ngày tải lên: 12/08/2014, 21:20