当前位置:网站首页>Using printf in MFC
Using printf in MFC
2022-04-23 06:43:00 【~Ha】
Step one :
Add the following code to the dialog initialization function OnInitDialog() in
AllocConsole();// The console debugging window opens
freopen("CONOUT$", "w", stdout);// Enable Chinese console output support
Step two :
Add the following code to the exit function
FreeConsole(); // Release console resources
If you use the default cross in the upper right corner, exit the interface , You can add the following code directly
void CMFCprintfDlg::OnClose()
{
// TODO: Add message handler code and / Or call the default value
FreeConsole(); // Release console resources
exit(0);
CDialogEx::OnClose();
}
Be careful :
The function used for printing is C Standard output function of language printf, stay vs If you use printf Still need to be in Engineering properties -> Configuration properties ->C/C++ -> Preprocessor definition Add **_CRT_SECURE_NO_WARNINGS**
版权声明
本文为[~Ha]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230548244798.html
边栏推荐
- vs中的多字节与unicode
- 产生随机数
- [opencv] use filestorage to read and write eigenvectors
- FOC 单电阻采样 位置环控制伺服电机
- [UDS unified diagnosis service] i. diagnosis overview (1) - diagnosis overview
- C语言输入和输出(printf和scanf函数、putchar和getchar函数)
- Cross domain issues - allow origin header contains multiple values but only one is allowed
- 数组旋转
- cartographer_node 编译没问题,但是运行直接挂掉的bug
- for()循环参数调用顺序
猜你喜欢

Swagger2 generates API documents

CUDA环境安装
![[UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture](/img/ef/173281ffb354b9abe1b730b89469cc.png)
[UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture

【UDS统一诊断服务】四、诊断典型服务(2)— 数据传输功能单元

【UDS统一诊断服务】四、诊断典型服务(6)— 输入输出控制单元(0x2F)

浮点数双精度,单精度以及半精度知识总结

C语言循环结构程序
![[UDS] unified diagnostic service (UDS)](/img/ed/8c16e4f1136fff95a829be410cab11.png)
[UDS] unified diagnostic service (UDS)

文件查看命令和用户管理命令

Installation of GCC, G + +, GDB
随机推荐
Eigen 学习总结
搭建jpress个人博客
copy constructor
vs中的多字节与unicode
Graduation project, viewing screenshots of epidemic psychological counseling system
[UDS] unified diagnostic service (UDS)
LaTeX配置与使用
Class inheritance and derivation
四元数乘法
如何读文献
C语言进阶要点笔记3
基于SSD的物体检测案例实现
【学习一下】HF-Net 训练
使用TransmittableThreadLocal实现参数跨线程传递
深蓝学院激光slam 理论与实践 第三章激光雷达去畸变 作业习题
基于Keras的时装分类案例
cuda工程更换环境(电脑)后遇到的一系列编译问题
Cross domain issues - allow origin header contains multiple values but only one is allowed
CUDA环境安装
声明为全局变量