【文章內(nèi)容簡介】
_pSetDelete()刪除當(dāng)前記錄 if(==0)若當(dāng)前記錄索引號課程設(shè)計(jì)說明書 沈 陽 大 學(xué) 為 0 , m_pSetMoveNext()下移一記錄 m_pSetMoveFirst()移動(dòng)到第一個(gè)記錄,UpdateData(FALSE)控件顯示成員變量的值。 如操作錯(cuò)誤 則出現(xiàn)如圖 9 所示提示 圖 9 錯(cuò)誤提示 部分程序代碼 【 1】 // : Defines the class behaviors for the application. // include include include include ifdef _DEBUG define new DEBUG_NEW undef THIS_FILE static char THIS_FILE[] = __FILE__。 endif ///////////////////////////////////////////////////////////////////////////// // CListTestCtrlApp BEGIN_MESSAGE_MAP(CListTestCtrlApp, CWinApp) 課程設(shè)計(jì)說明書 沈 陽 大 學(xué) //{{AFX_MSG_MAP(CListTestCtrlApp) // NOTE the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CListTestCtrlApp construction CListTestCtrlApp::CListTestCtrlApp() { // TODO: add construction code here, // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// // The one and only CListTestCtrlApp object CListTestCtrlApp theApp。 ///////////////////////////////////////////////////////////////////////////// // CListTestCtrlApp initialization BOOL CListTestCtrlApp::InitInstance() { AfxEnableControlContainer()。 // Standard initialization // If you are not using these features and wish to reduce the size 課程設(shè)計(jì)說明書 沈 陽 大 學(xué) // of your final executable, you should remove from the following // the specific initialization routines you do not need. ifdef _AFXDLL Enable3dControls()。 // Call this when using MFC in a shared DLL else Enable3dControlsStatic()。 // Call this when linking to MFC statically endif USkinInit(NULL,NULL,_T(skin\\))。 CListTestCtrlDlg dlg。 m_pMainWnd = amp。dlg。 int nResponse = ()。 if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } USkinExit()。 // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application39。s message pump. return FALSE。 } 課程設(shè)計(jì)說明書 沈 陽 大 學(xué) 3 運(yùn)行 結(jié)果與分析 系統(tǒng) 界面 主界面如圖所示 圖 5主界面 “ 添加 ” 按鈕調(diào)用函數(shù) OnAddRecord()并打開如圖對話框 ,其完整代碼如下 : void CListTestCtrlDlg::OnAddRecord() { CAddRecordDlg dlg。 CString str。 if(() == IDOK) { int count = m_pRecordsetGetRecordCount()。 if