Microsoft MVP성태의 닷넷 이야기
VC++: 24. error C2039: 'pOleStr' : is not a member of '_STRRET' [링크 복사], [링크+제목 복사],
조회: 23266
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

이 오류 만날 때마다 잊어버려서, 아예 홈페이지에 올려 놓으려고 합니다. ^^

구체적인 오류는 다음과 같습니다.

d:\XXX.cpp(205) : error C2039: 'pOleStr' : is not a member of '_STRRET'
        c:\program files\microsoft visual studio 8\vc\platformsdk\include\shtypes.h(165) : see declaration of '_STRRET'
d:\XXX.cpp(212) : error C2039: 'uOffset' : is not a member of '_STRRET'
        c:\program files\microsoft visual studio 8\vc\platformsdk\include\shtypes.h(165) : see declaration of '_STRRET'
d:\XXX.cpp(220) : error C2039: 'cStr' : is not a member of '_STRRET'
        c:\program files\microsoft visual studio 8\vc\platformsdk\include\shtypes.h(165) : see declaration of '_STRRET'

실제로 헤더 파일에 가면 아래와 같이 정의가 되어 있습니다.

typedef struct _STRRET
    {
    UINT uType;
    /* [switch_is][switch_type] */ union 
        {
        /* [case()][string] */ LPWSTR pOleStr;
        /* [case()] */ UINT uOffset;
        /* [case()] */ char cStr[ 260 ];
        } 	DUMMYUNIONNAME;
    } 	STRRET;

앞/뒤로, 아무리 if defined 같은 전처리기를 찾아봐도 위의 정의를 빼먹을 만한 컴파일러 지시자는 보이지 않습니다.

결국 어렵게 찾아 헤매다 보면,

stdafx.h에 정의되어 있는 아래의 매크로 상수가 문제였음을 알게 됩니다.

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
미련 없이 주석처리하시면, 컴파일러 에러는 없어집니다. ^^






[최초 등록일: ]
[최종 수정일: 3/20/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  3  4  5  6  7  8  [9]  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13832정성태11/27/202410056Windows: 274. Windows 7부터 도입한 conhost.exe
13831정성태11/27/20248899Linux: 111. eBPF - BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_MAP_TYPE_RINGBUF에 대한 다양한 용어들
13830정성태11/25/202411885개발 환경 구성: 736. 파이썬 웹 앱을 Azure App Service에 배포하기
13829정성태11/25/202411691스크립트: 67. 파이썬 - Windows 버전에서 함께 설치되는 py.exe
13828정성태11/25/20249639개발 환경 구성: 735. Azure - 압축 파일을 이용한 web app 배포 시 디렉터리 구분이 안 되는 문제파일 다운로드1
13827정성태11/25/202410866Windows: 273. Windows 환경의 파일 압축 방법 (tar, Compress-Archive)
13826정성태11/21/202410661닷넷: 2313. C# - (비밀번호 등의) Console로부터 입력받을 때 문자열 출력 숨기기(echo 끄기)파일 다운로드1
13825정성태11/21/202412000Linux: 110. eBPF (bpf2go) - BPF_RINGBUF_OUTPUT / BPF_MAP_TYPE_RINGBUF 사용법
13824정성태11/20/20249368Linux: 109. eBPF (bpf2go) - BPF_PERF_OUTPUT / BPF_MAP_TYPE_PERF_EVENT_ARRAY 사용법
13823정성태11/20/202411178개발 환경 구성: 734. Ubuntu에 docker, kubernetes (k3s) 설치
13822정성태11/20/202410994개발 환경 구성: 733. Windbg - VirtualBox VM의 커널 디버거 연결 시 COM 포트가 없는 경우
13821정성태11/18/202410926Linux: 108. Linux와 Windows의 프로세스/스레드 ID 관리 방식
13820정성태11/18/202411386VS.NET IDE: 195. Visual C++ - C# 프로젝트처럼 CopyToOutputDirectory 항목을 추가하는 방법
13819정성태11/15/20248335Linux: 107. eBPF - libbpf CO-RE의 CONFIG_DEBUG_INFO_BTF 빌드 여부에 대한 의존성
13818정성태11/15/202413593Windows: 272. Windows 11 24H2 - sudo 추가 [1]
13817정성태11/14/20249976Linux: 106. eBPF (bpf2go) - (BPF_MAP_TYPE_HASH) Map을 이용한 전역 변수 구현
13816정성태11/14/202411027닷넷: 2312. C#, C++ - Windows / Linux 환경의 Thread Name 설정파일 다운로드1
13815정성태11/13/20249163Linux: 105. eBPF - bpf2go에서 전역 변수 설정 방법
13814정성태11/13/202410336닷넷: 2311. C# - Windows / Linux 환경에서 Native Thread ID 가져오기파일 다운로드1
13813정성태11/12/202412011닷넷: 2310. .NET의 Rune 타입과 emoji 표현파일 다운로드1
13812정성태11/11/202415381오류 유형: 933. Active Directory - The forest functional level is not supported.
13811정성태11/11/20249971Linux: 104. Linux - COLUMNS 환경변수가 언제나 80으로 설정되는 환경
13810정성태11/10/202411466Linux: 103. eBPF (bpf2go) - Tracepoint를 이용한 트레이스 (BPF_PROG_TYPE_TRACEPOINT)
13809정성태11/10/202411156Windows: 271. 윈도우 서버 2025 마이그레이션
13808정성태11/9/202411984오류 유형: 932. Linux - 커널 업그레이드 후 "error: bad shim signature" 오류 발생
13807정성태11/9/20249569Linux: 102. Linux - 커널 이미지 파일 서명 (Ubuntu 환경)
1  2  3  4  5  6  7  8  [9]  10  11  12  13  14  15  ...