void CMFCDemoDlg::OnClickedGetrand() { wchar_t str[10]; //srand((unsigned)time(NULL)); int num = rand() ; _itow_s(num, str, 10); GetDlgItem(IDC_Rand)->SetWindowTextW(str); }
_itow 与_wtoi 实现文本值与int值的转化
void CMFCDemoDlg::OnClickedGetrand() { wchar_t str[10]; //srand((unsigned)time(NULL)); int num = rand() ; _itow_s(num, str, 10); GetDlgItem(IDC_Rand)->SetWindowTextW(str); }
_itow 与_wtoi 实现文本值与int值的转化