查MSDN是Windows程序员必须掌握的技能之一。
mk:@MSITStore:C:\MSDN98\98VS\2052\vcsample.chm::/html/_sample_mfc_enroll.htm
ENROLL: A Sample MFC Database Application
Click to open or copy STEP1
Click to open or copy STEP2
Click to open or copy STEP3
Click to open or copy STEP4
ENROLL is an example of a Microsoft Foundation Class Library (MFC) database application. The ENROLL sample has four subdirectories, named STEP1, STEP2, STEP3 and STEP4. The first three subdirectories correspond to steps in theDatabase Tutorial. STEP4, which adds more advanced features to the ENROLL database application, is not discussed in the tutorial but is discussed below.
The first three steps of ENROLL illustrate the following.
Code created by the AppWizard database option.
CRecordset and CRecordView classes.
Using MFC database classes in conjunction with the framework's document/view architecture.
Adding, updating, and deleting database records.
Handling database exceptions.
STEP4 of ENROLL illustrates the following.
Using multiple CRecordView-derived classes.
Switching views in a frame window.
Using update hints and CDocument::UpdateAllViews to coordinate multiple record views.
ENROLL STEP4 has the same user interface as ENROLL STEP3, with the addition of a new Form menu and a Course form. The Form menu lets you toggle between the Sections form and the Course form. When you add or delete a course in the Course form, the change is automatically reflected in the list of courses displayed in the dialog box in the Section form.
Note To run the ENROLL application, you must first set up the Student Registration Database and register it with ODBC. For information about how to do this, seeSetting Up the Student Registration Data Source.