Lab 2: Creating the STUpload Development Project

In this lab, you will use the MFC AppWizard to create a project for the STUpload.exe application introduced in Lab 1. You will be able to use this project as a basis for development labs in subsequent chapters.

  • To create the STUpload project
    1. Open Visual C++.
    2. On the File menu, click New.
    3. Select the MFC AppWizard (exe) option.
    4. Type STUpload as the project name.
    5. Click OK.
    6. STUpload will allow the user to work on only one document within a single instance of the application. Change the application type setting from Multiple Documents to Single Document. Click Next to proceed to Step 2, the database support screen.
    7. STUpload will provide the facility to query a database, but it will use ActiveX Data Objects to achieve this. Therefore, you do not need to implement MFC database support. Leave None selected and click Next to proceed to Step 3, the compound document options screen.
    8. You will not be implementing compound document support for STUpload, so leave None selected and click Next to proceed to Step 4, the application features screen.
    9. Accept the default options in this dialog box, and then click Advanced to open the Advanced Options dialog box.
    10. In the File Extension text box of the Document Template Strings page, type stu as the file extension. Click Close to close the Advanced Options dialog box.
    11. In the Filter Name box, the File New Name box and the File Type Name box, change the word STUplo to read STUpload.
    12. Click Close to close the Advanced Options dialog box, and click Next to proceed to Step 5 of the AppWizard.
    13. Leave the default options set and click Next to proceed to Step 6 of the AppWizard.
    14. You are going to implement a scrollable view for the STUpload application to allow you to view windows that are larger than the screen area. To enable this feature, you will derive your view class from the MFC CScrollView class, which implements scroll bars and scrolling behavior. Make sure that the CSTUploadView class is selected in the upper pane, and click CScrollView in the Base Class drop-down list.
    15. Click Finish, check through the New Project Information screen, and click OK to create the project.
    16. When the project is created, expand the STUpload Classes icon in the ClassView window to view the classes that AppWizard has created for you. Press F7 to build the project.
    17. Press CTRL+F5 to run the STUpload application. On the File menu, click Open. Note how the standard file dialog box is expecting you to open STUpload files with the .stu extension that you specified in Step 4 of the AppWizard. Select Cancel to close the Open File dialog box.
    18. Using the mouse, drag the bottom-right corner of the STUpload application window, and shrink the window until it is only a couple of inches square. Note how scrollbars appear automatically along the edges of the window client area.
    19. On the File menu, click Exit to close the STUpload application.


    Microsoft Press - Desktop Applications with Microsoft Visual C++ 6. 0. MCSD Training Kit
    Desktop Applications with Microsoft Visual C++ 6.0 MCSD Training Kit
    ISBN: 0735607958
    EAN: 2147483647
    Year: 1999
    Pages: 95

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net