generate rand() in text box
Hi ,
Trying to generate 6 digit random number and display in text box as RN: XXXXXX where X is the random number, have had some help but still unable to do the following:
1. Adding the "RN:" parameter to SetDlgItemInt function.
2. Converting iRandomNo to a displayable format.
Please advise , or point to example snippits.
thnx (hope the format is OK)
Code:
HWND hcombo = GetDlgItem( hwnd, IDC_TEXTBOX_EDIT);
int iRandomNo=0;
for(int i=0;i<6;i++)
{
iRandomNo = iRandomNo*10 + rand()/10;
}
std::ostringstream stm;
SetDlgItemInt(hwnd, IDC_TEXTBOX_EDIT, "RN:", stm);