使用vc6建立一个MFC DIALOG工程
从工程中添加calendar control 8.0,将其放置在对话框上,然后随便摆个Button,双击
1  
在 D:\myvc\CH03 目录创建应用程序 MyCal.exe。用 MFC 标准和对话框模式。 
2  
添加日历控件,把它拉拽到的合适大小,再加入1个按钮。日历控件的 ID 就用默认的。 

为了使用这个控件,给它定义一个控件变量 m_cal。用右键点击工作区的类
CMyCalenderDlg,在快捷菜单中选择“添加变量”。
4
为按钮加入代码    m_cal.Today();5 编译运行出现Debug Assertion Failed错误
请问各位大侠这是怎么回事啊???该如何解决

解决方案 »

  1.   

    CSDN上有说明和实例:
     CMonthCalCtrl* pCtrl = (CMonthCalCtrl*) GetDlgItem(IDC_MONTHCALENDAR1);   COleDateTime timeToday;
       if (pCtrl->GetToday(timeToday))
       {
          // Format the date information from the value we received
          // and post a message box about it.
          CString str = timeToday.Format(VAR_DATEVALUEONLY);
          AfxMessageBox(str);      // Set the control's "today" indicator to be five
          // days previous.
          timeToday -= 5;
          pCtrl->SetToday(timeToday);
       }
       else
       {
          // Something is wrong!
          ASSERT(FALSE);
       }
      

  2.   

    现在看来像是指针跨界出错,给分
    你说的csdn上的说明在哪?给个连接吧