MFC ListView_GetCheckState(SetCheckState)버그

|

ListView에서 체크박스를 사용할 경우 사용되는
ListView_GetCheckState와 ListView_SetCheckState매크로 함수중
Get은 잘 되나 Set은 컴파일시 Undefined라고 뜨는 경우가 있는데
이는 VC++6의 버그이며 VC++7에서는 수정되었다.

listview 에서 check box 를 사용할때 체크박스를 이용하기 위해서 두가지 함수를 사용합니다.

ListView_SetCheckState(HWND hwndLV, UINT iIndex, BOOL fCheck);
BOOL ListView_GetCheckState(HWND hwndLV, UINT iIndex);

기능은 매크로 이름에서 알수 있습니다.

컴파일 하다보면 ListView_SetCheckState 가 선언되지 않은 식별자라고 나올때가 있습니다.
이런 경우에 헤더파일에 아래와 같이 정의해 주면 됩니다.

#ifndef ListView_SetCheckState
#define ListView_SetCheckState(hwndLV, i, fCheck) \
ListView_SetItemState(hwndLV, i, \
INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK)
#endif

출처 -
http://www.mnxnet.com/~takun/tips/00.html

'Knowledge > C/C++/VC++' 카테고리의 다른 글

프로세스 구하기/kill하기  (0) 2007.05.04
Win32 플랫폼 버전 확인  (0) 2007.05.04
URL(File) Drag&Drop  (0) 2007.05.04
Winpcap 프로젝트 셋팅  (0) 2007.05.04
VC++6에서 유니코드 프로젝트 셋팅  (0) 2007.05.04
And