MFC에서 printf 출력을 콘솔 화면에 보고 싶을때가 있다. 필자는 거의 프로그램을 짤때 이용하는 편이다.
아래와 같이 Stdafx.h 에 넣어두면 좋다.
1
2
3
4
5
6
7
8
9
10
|
// stdafx.h : 자주 사용하지만 자주 변경되지는 않는
// 표준 시스템 포함 파일 및 프로젝트 관련 포함 파일이
// 들어 있는 포함 파일입니다.
#pragma once
#pragma comment(linker, "/entry:wWinMainCRTStartup /subsystem:console")
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // 거의 사용되지 않는 내용은 Windows 헤더에서 제외합니다.
#endif
|
cs |
유니코드의 경우
#pragma comment(linker, "/entry:wWinMainCRTStartup /subsystem:console")
멀티바이트의 경우
#pragma comment(linker, "/entry:WinMainCRTStartup /subsystem:console")
#ifdef _UNICODE
#pragma comment(linker, "/entry:wWinMainCRTStartup /subsystem:console")
#else
#pragma comment(linker, "/entry:WinMainCRTStartup /subsystem:console")
#endif
'Language & API > MFC' 카테고리의 다른 글
다이얼로그에 클래스 연결하기 (0) | 2022.03.10 |
---|---|
[MFC] Radio 라디오 버튼 그룹 지정해서 사용하기 (0) | 2021.05.27 |
[MFC] 다이얼로그 창 크기 고정 시키기 (0) | 2021.05.27 |
MFC Slider Control(슬라이더 컨트롤) 사용법 (0) | 2021.05.26 |
MFC 계층 구조 차트 (0) | 2017.04.12 |