國立暨南國際大學 101 學年度第二學期小考試卷                   (考試時間: 08:10-08:20)
科目名稱:程式設計 開課系所:資訊工程 學系 任課教師
吳坤熹
系所別:
年級:
學號:
姓名:
考試日期
2013.6.7
  1. (10%) Consider an MFC application with the following code.  Assume the Sort property of the list box is True.  Predict the contents of the list box after the application starts, and identify the item that will be pre-selected.

    void CQuiz14View::OnInitialUpdate()
    {
        CFormView::OnInitialUpdate();
        GetParentFrame()->RecalcLayout();
        ResizeParentToFit();
       
        CListBox* pListBox =
            static_cast<CListBox*>(GetDlgItem(IDC_LIST1));
        char weekday[][4] = { "Mon", "Tue", "Wed", "Thu", "Fri" };
        for (int i=0; i < sizeof(weekday)/sizeof(weekday[0]); i++)
            pListBox->AddString( CString(weekday[i]) );
        pListBox->SetCurSel(2);

    }