Programming with Microsoft Visual C++.NET 6ed [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Programming with Microsoft Visual C++.NET 6ed [Electronic resources] - نسخه متنی

George Shepherd, David Kruglinski

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید








The Ex21c Example: An MDI Application


Now let's create an MDI application that doesn't use the document-view architecture.



    Run the MFC Application Wizard to produce the Ex21c project. Select the Multiple Documents option on the Application Type page and deselect Document/View Architecture Support.



    Add code to paint in the dialog box.Add the following boldface code to the CChildView::OnPaint function in the

    ChildView.cpp source code file:

    void CChildView::OnPaint() 
    {
    CPaintDC dc(this); // device context for painting
    dc.TextOut(0, 0, "Hello, world!");
    // Do not call CWnd::OnPaint() for painting messages
    }



    Compile and run the application. You now have a complete MDI application without any dependencies on the document-view architecture.

    As in Ex21b, this example automatically creates a CChildView class. The main difference between Ex21b and Ex21c is that in Ex21c the CChildView class is created in the CChildFrame::OnCreate function instead of in the CMainFrame class.



Now that you've learned how to create three kinds of applications that do not depend on the document-view architecture, you can examine how they're generated to learn how MFC works. Try comparing the generated results to similar applications with document-view architecture support to get a complete picture of how the document-view classes work with the rest of MFC.


/ 319