microsoft visual c windows application by example pdf

Microsoft Visual C++ Windows Applications by Example phần 3 pdf

Microsoft Visual C++ Windows Applications by Example phần 3 pdf

... indirect) subclass of CObject CRuntimeClass* GetRuntimeClass() const; void WriteClass(const CRuntimeClass* pClass); void WriteObject(const CObject* pObject); CRuntimeClass* ReadClass(const CRuntimeClass* ... context The device context class CDC is a very central part of a Windows application However, CDC is an abstract class, a device context object is instantiated from the subclass ClientDC In order ... static const COLORREF GREY = RGB(128, 128, 128); static const COLORREF BLACK = RGB(0, 0, 0); class CRingDoc : public CDocument { protected: // create from serialization only CRingDoc(); DECLARE_DYNCREATE(CRingDoc)...

Ngày tải lên: 12/08/2014, 21:20

43 781 0
Microsoft Visual C++ Windows Applications by Example ppt

Microsoft Visual C++ Windows Applications by Example ppt

... Microsoft Visual C+ + Windows Applications by Example Code and Explanation for Real-World MFC C+ + Applications Stefan Björnander BIRMINGHAM - MUMBAI Microsoft Visual C+ + Windows Applications by ... Letters Class Example st CString CString stBuffer; pt CPoint CPoint ptMouse; sz CSize CSize szText; rc CRect CRect rcClip; A pointer to an object has the initial p SyntaxTree* pTree; [ 20 ] Chapter ... another object We can overload operators and we can throw exceptions We can create generic classes by using templates and we can organize our classes into namespaces Preface Chapter Windows Development—The...

Ngày tải lên: 27/06/2014, 12:20

435 417 0
Microsoft Visual C++ Windows Applications by Example phần 2 doc

Microsoft Visual C++ Windows Applications by Example phần 2 doc

... operator The second and third of the following lines are completely interchangeable BankAccount accountOriginal(123); BankAccount accountCopy1(accountOriginal); BankAccount accountCopy2 = accountOriginal; ... copyAccount(account1); cout

Ngày tải lên: 12/08/2014, 21:20

43 332 0
Microsoft Visual C++ Windows Applications by Example phần 4 pptx

Microsoft Visual C++ Windows Applications by Example phần 4 pptx

... HideFocus is called, which in 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); ... color Color.h class Color { public: Color(); Color(const COLORREF crRedGreenBlue); Color(const Color& color); operator COLORREF() const; Color& operator=(const Color& color); void Serialize(CArchive& ... m_pFocusView->OnPrepareDC(&dc); dc.LPtoDP(m_rcCaret); m_rcCaret.left = min(m_rcCaret.left, m_rcCaret.right - 1); if (m_rcCaret.left < 0) { m_rcCaret.right += abs(m_rcCaret.left); m_rcCaret.left = 0; } [ 134 ] Chapter...

Ngày tải lên: 12/08/2014, 21:20

43 381 0
Microsoft Visual C++ Windows Applications by Example phần 5 pot

Microsoft Visual C++ Windows Applications by Example phần 5 pot

... Serialize(CArchive& archive); HCURSOR GetCursor() const; BOOL Click(const CPoint& ptMouse); BOOL DoubleClick(const CPoint& ptMouse); BOOL Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& ... Inside(const CRect& rcInside) const; void MoveOrModify(const CSize& szDistance); void Move(const CSize& szDistance); void Draw(CDC* pDC) const; CRect GetArea() const; private: enum {CREATE_RECTANGLE, ... RectangleFigure(const RectangleFigure& rectangle); Figure* Copy() const; void Serialize(CArchive& archive); HCURSOR GetCursor() const; BOOL Click(const CPoint& ptMouse); BOOL DoubleClick(const CPoint&...

Ngày tải lên: 12/08/2014, 21:20

43 310 0
Microsoft Visual C++ Windows Applications by Example phần 6 docx

Microsoft Visual C++ Windows Applications by Example phần 6 docx

... scrolling and displaying of the spreadsheet We use the Application Wizard to generate the classes CCalcApp, CMainFrame, CChildFrame, CCalcDoc, CCalcView, and CAboutDlg We will modify CCalcDoc ... cxMargin; cxMargin; cyMargin; cyMargin; [ 235 ] The Draw Application CClientDC dc(this); OnPrepareDC(&dc); dc.LPtoDP(rcClip); InvalidateRect(rcClip); } OnUpdate is also called by OnIntialUpdate in CScrollView ... { CRect rcClip = *(CRect*) lHint; int cxMargin = (int) (0.05 * rcClip.Width()); int cyMargin = (int) (0.05 * rcClip.Height()); rcClip.left rcClip.right rcClip.top rcClip.bottom -= += -= += cxMargin;...

Ngày tải lên: 12/08/2014, 21:20

43 360 0
Microsoft Visual C++ Windows Applications by Example phần 7 pptx

Microsoft Visual C++ Windows Applications by Example phần 7 pptx

... TSetMatrix; class CCalcDoc; [ 270 ] Chapter class Cell { public: Cell(); Cell(const Cell& cell); Cell& operator=(const Cell& cell); void CopyCell(const Cell& cell); void SetCellMatrix(CellMatrix* pCellMatrix) ... bMarked, CDC *pDC) { CRect rcCell(ptTopLeft, CSize(COL_WIDTH, ROW_HEIGHT)); CRect rcMargin(rcCell.left + CELL_MARGIN, rcCell.top + CELL_MARGIN, rcCell.right - CELL_MARGIN, rcCell.bottom - CELL_MARGIN); ... penColor); CPen* pPrevPen = pDC->SelectObject(&pen); CBrush brush(brushColor); CBrush* pPrevBrush = pDC->SelectObject(&brush); pDC->Rectangle(rcCell); pDC->SelectObject(pPrevPen); pDC->SelectObject(pPrevBrush);...

Ngày tải lên: 12/08/2014, 21:20

43 296 0
Microsoft Visual C++ Windows Applications by Example phần 8 ppsx

Microsoft Visual C++ Windows Applications by Example phần 8 ppsx

... void CCalcView::OnSize(UINT /* uType */, int cxClient, int cyClient) { CClientDC dc(this); OnPrepareDC(&dc); CRect rcClient(0, 0, cxClient, cyClient); dc.DPtoLP(&rcClient); SCROLLINFO scrollInfo; ... { switch (m_eCalcStatus) { case CS_MARK: m_caret.HideCaret(); break; case CS_EDIT: CCalcView* pCalcView = (CCalcView*) m_caret.GetView(); [ 297 ] The Calc Application if (pCalcView->IsCellVisible(m_rfEdit.GetRow(), ... large screen) void CCalcView::OnDraw(CDC* pDC) { CRect rcClient; GetClientRect(&rcClient); pDC->DPtoLP(&rcClient); CPen pen(PS_SOLID, 0, LIGHT_GRAY); CPen *pOldPen = pDC->SelectObject(&pen); CBrush...

Ngày tải lên: 12/08/2014, 21:20

43 349 0
Microsoft Visual C++ Windows Applications by Example phần 9 doc

Microsoft Visual C++ Windows Applications by Example phần 9 doc

... PointToChar(CPoint ptMouse); CRect CharToRect(int iChar); CRect GetCaretRect(int iChar); CRect CharToLineRect(int iChar); void Recalculate(CDC* pDC, RectSet* pRepaintSet = NULL); void ClearRectArray(); ... rcChar.right, rcChar.bottom); return szUpperLeft + rcCaret; } else { CRect rcChar = m_rectArray[iChar - 1]; CRect rcCaret(rcChar.right, rcChar.top, rcChar.right + rcChar.Width(), rcChar.bottom); ... Word Application else if (iChar == 0) { return szUpperLeft + m_rectArray[0]; } else if (isHomeChar(iChar)) { CRect rcChar = m_rectArray[iChar]; CRect rcCaret(rcChar.left, rcChar.top, rcChar.right,...

Ngày tải lên: 12/08/2014, 21:20

43 363 0
Microsoft Visual C++ Windows Applications by Example phần 10 ppt

Microsoft Visual C++ Windows Applications by Example phần 10 ppt

... scroll bars void CWordView::OnSize(UINT /* uType */, int cxClient, int cyClient) { CClientDC dc(this); OnPrepareDC(&dc); CSize szClient(cxClient, cyClient); dc.DPtoLP(&szClient); SCROLLINFO scrollInfo; ... height for each page [ 403 ] The Word Application void CWordView::OnPaint() { CPaintDC dc(this); OnPrepareDC(&dc); CRect rcClient; GetClientRect(&rcClient); dc.DPtoLP(&rcClient); if (rcClient.right ... multiple document interface (MDI) 89 single doucment interface (SDI) 89 document/view model, calc application CalcDoc.cpp 295-307 CalcDoc.h 293-295 CalcView.cpp 319-327 document class 291, 292 document...

Ngày tải lên: 12/08/2014, 21:20

47 325 0
Microsoft Visual C# 2012 Step by Step pdf

Microsoft Visual C# 2012 Step by Step pdf

... Introducing Microsoft Visual C# and Microsoft Visual Studio 2012 Microsoft Visual C# is Microsoft s powerful component-oriented language C# plays an important role in the architecture of the Microsoft ... Windows Search contract A user can search for customers by first name or last name Chapter 27 Data Service This solution includes a web application that provides a WCF Data Service that the Customers ... Step by Step for Developers series available from Microsoft Press, such as Microsoft ASP.NET Step by Step, Microsoft ADO.NET Step by Step, and Microsoft Windows Communication Foundation Step by...

Ngày tải lên: 29/03/2014, 02:20

844 3,3K 6
Microsoft Visual C# 2010 Step by Step (P2) potx

Microsoft Visual C# 2010 Step by Step (P2) potx

... select WPF Application Choose a name for the project Click OK Build the application On the Build menu, click Build Solution Run the application On the Debug menu, click Start Without Debugging Chapter ... click Project to open the New Project dialog box In the left pane, under Installed Templates, click Visual C# In the middle pane, click Console Application Specify a directory for the project ... Introducing Microsoft Visual C# and Microsoft Visual Studio 2010 17 On the Build menu, click Build Solution, and verify that the project builds successfully 18 On the Debug menu, click Start...

Ngày tải lên: 05/07/2014, 16:20

50 364 1
Microsoft Visual C# 2010 Step by Step (P3) pps

Microsoft Visual C# 2010 Step by Step (P3) pps

... recommended The exception object passed in to the catch handler can contain useful information concerning the exception, which is not accessible when using this version of the catch construct ... Microsoft Visual C# and Microsoft Visual Studio 2010 list box, select MathsOperators – Microsoft Visual Studio: Visual Studio 2010 and then click Yes: If you are using Visual C# 2010 Express, click Close ... File menu, click Exit If you see a Save dialog box, click Yes and save the project 108 Part I  Introducing Microsoft Visual C# and Microsoft Visual Studio 2010 Chapter Quick Reference To Do this...

Ngày tải lên: 05/07/2014, 16:20

50 350 1
Microsoft Visual C# 2010 Step by Step (P5) potx

Microsoft Visual C# 2010 Step by Step (P5) potx

... reference type, you will have two references to the same object For example: Circle c = new Circle(42); Circle refc = c; Declare a variable that can hold a value type or the null value Declare ... randomCardSelector to shuffle the cards before they are dealt to each hand class Pack { public const int NumSuits = 4; public const int CardsPerSuit = 13; private PlayingCard[,] cardPack; private ... the cardPack array with the correct number of elements: public Pack() { this.cardPack = new PlayingCard[NumSuits, CardsPerSuit]; } 11 Add the following code shown in bold to the Pack constructor...

Ngày tải lên: 05/07/2014, 16:20

50 432 1
Microsoft Visual C# 2010 Step by Step (P6) potx

Microsoft Visual C# 2010 Step by Step (P6) potx

... mouseLocation = e.GetPosition(this.drawingCanvas); Circle myCircle = new Circle(100); if (myCircle is IDraw) { IDraw drawCircle = myCircle; drawCircle.SetLocation((int)mouseLocation.X, (int)mouseLocation.Y); ... (int)mouseLocation.Y); drawCircle.Draw(drawingCanvas); } } if (myCircle is IColor) { IColor colorCircle = myCircle; colorCircle.SetColor(Colors.HotPink); } On the Debug menu, click Start Without Debugging ... Ellipse(); } } this.circle.Height = this.radius; this.circle.Width = this.radius; Canvas.SetTop(this.circle, this.locY); Canvas.SetLeft(this.circle, this.locX); canvas.Children.Add(circle); This method...

Ngày tải lên: 05/07/2014, 16:20

50 303 1
w