원본 : http://www.debuglab.com/knowledge/atldebuginfo.html
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 같은곳에 정의하면 많은 정보들을 볼 수 있다.
3.예제
4.참고
ATL Internals
- 2001.08.13 Smile Seo -
"ATL/COM" 카테고리의 다른 글
- ActiveX 컨트롤로부터 URL 알아내기 (0)2007/03/23
- [ActiveX] 키보드 메세지 받기 (0)2007/03/21
- ATL 디버깅 정보 출력하기 (0)2007/03/21
- 웹페이지가 이동될때 진입하는 함수 (0)2007/03/17
- ActiveX를 무조건 다운로드 하게 하기 (0)2007/03/15

수안이의 컴퓨터 연구실



Leave your greetings.