建立一个基于dialog的项目,只有如下动作:
void CTimeDlg::OnButton1()
{
// TODO: Add your control notification handler code here
time_t xianzai;m_sec=time(&xianzai);
m_sec1=Second(&xianzai); //希望返回当前系统秒数!UpdateData(FALSE);
}
但是编译总是提示: error C2065: 'Hour' : undeclared identifier!
应怎样做?
void CTimeDlg::OnButton1()
{
// TODO: Add your control notification handler code here
time_t xianzai;m_sec=time(&xianzai);
m_sec1=Second(&xianzai); //希望返回当前系统秒数!UpdateData(FALSE);
}
但是编译总是提示: error C2065: 'Hour' : undeclared identifier!
应怎样做?
time()也没声明呀.
GetLocalTime
The GetLocalTime function retrieves the current local date and time. VOID GetLocalTime(
LPSYSTEMTIME lpSystemTime // system time
);
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;
Hour函数没用过
刚刚用MSDN看了一下
好像Hour函数是VB里的?