고수닷넷 - 디버깅전문가님
1.요약
atlTraceFlags를 이용하여 디버깅시 ATL에 관련된 정보를 출력할 수 있다.
2.본문
MFC와 달리 ATL의 경우는 중요 메쏘드나 프러퍼티들에 trace하여 자신의 상태와 실행위치를 출력해주는 코드가 들어있다. 이러한 trace코드를 활성화 시키기위해서는 trace level과 category를 정의하면 되는데 다음과 같이 정의한다.
#ifndef ATL_TRACE_CATEGORY #define ATL_TRACE_CATEGORY 0xFFFFFFFF #endif #ifdef _DEBUG #ifndef ATL_TRACE_LEVEL #define ATL_TRACE_LEVEL 0 #endif
위의 정의는 ATLBASE.h에 디폴트로 정의된 값이다. 이렇게하면 ATL은 trace를 전혀 하지않는다.
caltegory와 level은 다음과 같이 정의 되어있다.
enum atlTraceFlags
{
// Application defined categories
atlTraceUser = 0x00000001,
atlTraceUser2 = 0x00000002,
atlTraceUser3 = 0x00000004,
atlTraceUser4 = 0x00000008,
// ATL defined categories
atlTraceGeneral = 0x00000020,
atlTraceCOM = 0x00000040,
atlTraceQI = 0x00000080,
atlTraceRegistrar = 0x00000100,
atlTraceRefcount = 0x00000200,
atlTraceWindowing = 0x00000400,
atlTraceControls = 0x00000800,
atlTraceHosting = 0x00001000,
atlTraceDBClient = 0x00002000,
atlTraceDBProvider = 0x00004000,
atlTraceSnapin = 0x00008000,
atlTraceNotImpl = 0x00010000,
};
category를 잘 들여다보면 각 부문별로 분류되어있는것을 알수 있다(^ ^!)
stdafx.h 같은곳에 정의하면 많은 정보들을 볼 수 있다.
참고
ATL Internals...
"Debugging" 카테고리의 다른 글
- LastError를 보여주는 Debugging Trace Macro (0)2007/03/05
- Dll에 breakpoint 설치하기 (0)2007/02/22
- Microsoft .NET Framework SDK 디버거 설명서 (0)2007/01/22
- Set Next Statement를 이용하여 디버깅하기 (0)2007/01/22
- ATL 디버깅 정보 출력하기 (0)2007/01/22

수안이의 컴퓨터 연구실



Leave your greetings.