Function to print to an edit box Parameters: dlg - the dialog that the edit box is in id - the ID of the edit box fmt - printf-style text & arguments
| 1049 | // id - the ID of the edit box |
| 1050 | // fmt - printf-style text & arguments |
| 1051 | void PrintToDlgItem(CDialog *dlg, int id, char *fmt, ...) { |
| 1052 | std::va_list arglist; |
| 1053 | char str[3000]; |
| 1054 | int len; |
| 1055 | CEdit *ebox; |
| 1056 | |
| 1057 | va_start(arglist, fmt); |
| 1058 | len = std::vsnprintf(str, 3000, fmt, arglist); |
| 1059 | va_end(arglist); |
| 1060 | ASSERT(len < 3000); |
| 1061 | |
| 1062 | ebox = (CEdit *)dlg->GetDlgItem(id); |
| 1063 | if (ebox == NULL) { |
| 1064 | Int3(); |
| 1065 | return; |
| 1066 | } |
| 1067 | ebox->SetWindowText(str); |
| 1068 | } |
| 1069 | |
| 1070 | // A quick way to use an openfiledialog/savefiledialog. |
| 1071 | // wnd = parent window |
no outgoing calls
no test coverage detected