MFC里怎么用AfxMessageBox显示变量?

2025-02-19 03:04:01
推荐回答(2个)
回答1:

CString str;
str.Format(_T("%d"), your_变量);
AfxMessageBox(str);

回答2:

CString strCap = "Caption";
int icap = 555;
CString Cap;
Cap.Format ( "标题%s\n变量%d", strCap,icap );
AfxMessageBox ( Cap.GetString (), MB_OK, 0 );