Microsoft MVP성태의 닷넷 이야기
VC++: 24. error C2039: 'pOleStr' : is not a member of '_STRRET' [링크 복사], [링크+제목 복사],
조회: 17922
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... 181  182  183  184  185  186  [187]  188  189  190  191  192  193  194  195  ...
NoWriterDateCnt.TitleFile(s)
281정성태8/11/200627371    답변글 개발 환경 구성: 3.2. VS.NET 2005 원격 디버깅 설정
315정성태8/11/200628032        답변글 개발 환경 구성: 3.3. VS.NET 2005 원격 디버깅 설정 - ASP.NET F5 디버깅
278정성태6/11/200624571오류 유형: 8. [Outlook] 0x8004011D 에러 - "Exchange over the Internet" 환경
276정성태6/7/200618150Team Foundation Server: 7. 외부 빌드 머신 구성
287정성태6/24/200615718    답변글 Team Foundation Server: 7.1. 외부 빌드 머신 구성 - 다른 블로그 자료
275정성태6/7/200623552디버깅 기술: 4. VC++ 8.0 원격 디버깅 구성 - Side-by-Side DLL 문제.
269정성태6/6/200620783Team Foundation Server: 6. HTTPS를 통한 Team Server 접근 [1]
270정성태6/5/200617717    답변글 Team Foundation Server: 6.1. HTTPS를 통한 Team Server 접근 [1]
273정성태6/6/200620455    답변글 Team Foundation Server: 6.2. 두번째 방법 - HTTPS 를 통한 Team Server 접근 [1]
267정성태6/4/200619762Team Foundation Server: 5. 인터넷으로 Team Server 접근 [2]
266정성태6/8/200616382오류 유형: 7. [설치] mpoai9.dll 관련 오류
265정성태6/1/200624082디버깅 기술: 3. 원격 컴퓨터 디버깅 - VPC 설정
314정성태8/11/200621068    답변글 디버깅 기술: 3.1. Managed 원격 디버깅과 WinDBG 원격 디버깅
264정성태6/1/200630199오류 유형: 6. [VC++ 컴파일] already defined in ntdll.lib(ntdll.dll)
263정성태6/1/200631178디버깅 기술: 2. 커널 구조체 살펴보기 [5]
262정성태6/1/200623478오류 유형: 5. [설치] WinFX Beta2 - 설치시 문제점 해결
261정성태6/1/200619941웹: 3. IIS 6.0 - AppPool을 활용하여 실 서버(운영 서버)에서 디버깅
258정성태6/1/200627849디버깅 기술: 1. 디버깅 방법 - CLR 프로파일러 [1]파일 다운로드1
274정성태6/7/200620781    답변글 디버깅 기술: 1.1. 디버깅 방법 - CLR 프로파일러 ( on Vista )
254정성태6/1/200617312개발 환경 구성: 2. VPC에 Vista 설치하는 방법 [2]
255정성태6/1/200617004    답변글 개발 환경 구성: 2.1. msconfig 설정과 Windows Activation
259정성태6/1/200616093    답변글 개발 환경 구성: 2.2. Vista VPC에 터미널 서비스 - 원격 접속
253정성태6/1/200614468기타: 14. .NET 2.0 이 지원되는 NDoc 2.0 을 배포합니다.
251정성태6/1/200617404오류 유형: 4. [OS 지원 API] SHParseDisplayName과 Windows 2000
252정성태6/1/200617329    답변글 오류 유형: 4.1. NET BCL 에서 제공되는 FolderBrowserDialog [2]
249정성태6/1/200616674.NET Framework: 71. VB.NET 이외의 언어에서 My 네임스페이스 사용
... 181  182  183  184  185  186  [187]  188  189  190  191  192  193  194  195  ...