在MFC Dialog中显示cmd窗口

打开Project -> Properties,在Build Events -> Post-Build Event里的Command Line中输入:    

editbin /SUBSYSTEM:CONSOLE $(OUTDIR)\filename.exe
(其中filename.exe为可执行文件)

 例如你的可执行文件名为  MFCApplication.exe,则你的Command Line就为:

editbin /SUBSYSTEM:CONSOLE $(OUTDIR)\MFCApplication.exe

 

 保存完设置后就可以使用printf或者std::cout在控制台中输出了:

 

 

posted on 2018-06-22 17:12  FlyingPig007  阅读(1037)  评论(0编辑  收藏  举报

导航