Formatted MessageBox/AfxMessageBox
2012-05-01 17:33
246 查看
void AfxMessageBoxFormatted(LPCTSTR pFormatString, ...) { va_list vl; va_start(vl, pFormatString); CString strFormat; strFormat.FormatV(pFormatString, vl); AfxMessageBox(strFormat); }
void MessageBoxFormatted(HWND hWnd, LPCTSTR pCaption, LPCTSTR pFormatString, ...) { va_list vl; va_start(vl, pFormatString); TCHAR strFormat[1024]; _vstprintf(strFormat, pFormatString, vl); ::MessageBox(hWnd, strFormat, pCaption,MB_ICONINFORMATION); }
原文章网址: http://www.codeproject.com/Tips/120013/Formatted-MessageBox-AfxMessageBox
使用示例:
int i = 100;
MessageBoxFormatted(NULL, TEXT("Hello Kitty"), TEXT("%d"), i);
相关文章推荐
- 自定义扩展MessageBox(Formatted MessageBox/AfxMessageBox)
- Formatted MessageBox/AfxMessageBox
- AfxMessageBox和MessageBox的用法
- MessageBox显示变量及与AfxMessageBox区别
- AfxMessageBox与MessageBox
- AfxMessageBox和MessageBox差别
- AfxMessageBox和MessageBox差别
- AfxMessageBox和MessageBox差别
- MFC之MessageBox、AfxMessageBox用法
- AfxMessageBox和MessageBox的用法
- VC++中的MessageBox()与AfxMessageBox()
- AfxMessageBox和MessageBox区别
- AfxMessageBox和MessageBox区别[转]
- AfxMessageBox和MessageBox区别
- MessageBox()与AfxMessageBox()的区别
- MessageBox详解,附带AfxMessageBox
- VC中MessageBox与AfxMessageBox用法与区别
- MessageBox、::MessageBox 、AfxMessageBox三者的区别
- AfxMessageBox和MessageBox差别
- AfxMessageBox和MessageBox差别