void CmdiView::OnDraw(CDC* pDC)
{
CmdiDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此加入原生資料的描繪程式碼
CTime cur_tm;
cur_tm = CTime::GetCurrentTime();
int year = cur_tm.GetYear();
int month = cur_tm.GetMonth();
int date = cur_tm.GetDay();
int DayOfWeek = cur_tm.GetDayOfWeek(); // 禮拜幾,1=SUN ... 7=SAT
int hour = cur_tm.GetHour();
int minute = cur_tm.GetMinute();
int Second = cur_tm.GetSecond();
CString ss;
ss.Format(_T("%4d/%02d/%02d %02d:%02d:%02d, 禮拜%d"), year, month, date, hour, minute, Second, DayOfWeek);
pDC->TextOut(0, 0, ss);
}
全站熱搜
留言列表