이 오류 만날 때마다 잊어버려서, 아예 홈페이지에 올려 놓으려고 합니다. ^^
구체적인 오류는 다음과 같습니다.
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
미련 없이 주석처리하시면, 컴파일러 에러는 없어집니다. ^^
| Title |
| 11166 | 정성태 | 3/28/2017 | 25630 | 오류 유형: 382. System.Data.SqlClient.SqlException - Arithmetic overflow error converting IDENTITY to data type int. | |
| 11165 | 정성태 | 3/27/2017 | 27610 | 오류 유형: 381. Visual C++에서 min, max 함수를 사용한 경우 C2589, C2059 컴파일 오류 발생 | |
| 11164 | 정성태 | 3/27/2017 | 36328 | VC++: 111. C++ 클래스의 상속에 따른 메모리 구조 [2] | 1 |
| 11163 | 정성태 | 3/25/2017 | 26223 | VC++: 110. CreateThread Win32 API에 C++ 클래스의 멤버 함수를 전달하는 방법 | 1 |
| 11162 | 정성태 | 3/24/2017 | 31310 | 오류 유형: 380. Visual Studio 빌드 실패 - The OutputPath property is not set for project | |
| 11161 | 정성태 | 3/24/2017 | 21257 | 오류 유형: 379. ICOMAdminCatalog.GetCollection 호출 시 0x80070422 예외 발생 | |
| 11160 | 정성태 | 3/23/2017 | 28749 | .NET Framework: 649. ASP.NET - Server cannot append header after HTTP headers have been sent. (HTTP 헤더를 보낸 후에는 서버에서 헤더를 추가할 수 없습니다.) | 1 |
| 11159 | 정성태 | 3/23/2017 | 25139 | Windows: 136. Memory-mapped File은 Private Bytes 크기에 포함될까요? | 1 |
| 11158 | 정성태 | 3/22/2017 | 23734 | 디버깅 기술: 85. Windbg - SOS 디버깅 사례 System.NullReferenceException 예외 추적 | |
| 11157 | 정성태 | 3/22/2017 | 26691 | .NET Framework: 648. Dictionary<TKey, TValue>를 deep copy하는 방법 | 1 |
| 11156 | 정성태 | 3/21/2017 | 28898 | .NET Framework: 647. 닷넷(C#) 코드로 인증서 요청 코드 만드는 방법 | 1 |
| 11155 | 정성태 | 3/21/2017 | 29384 | .NET Framework: 646. SslStream의 CipherAlgorithm 선택이 가능할까요? | 1 |
| 11154 | 정성태 | 3/5/2017 | 34239 | VC++: 109. DLL에서 STL 객체를 인자/반환값으로 갖는 함수를 제공할 때, 그 함수를 외부에서 사용하는 경우 비정상 종료한다면? [2] | 1 |
| 11153 | 정성태 | 3/5/2017 | 34951 | VC++: 108. DLL에 정의된 C++ template 클래스의 복사 생성자 문제 | 1 |
| 11152 | 정성태 | 3/4/2017 | 30614 | VC++: 107. VirtualAlloc, HeapAlloc, GlobalAlloc, LocalAlloc, malloc, new의 차이점 [1] | 1 |
| 11151 | 정성태 | 3/3/2017 | 29596 | VC++: 106. DLL 개발자가 주의해야 할 Secure CRT 함수 사용 [1] | 1 |
| 11150 | 정성태 | 2/21/2017 | 24781 | .NET Framework: 645. Visual Studio Fakes 기능에서 Shim... 클래스가 생성되지 않는 경우 [5] | |
| 11149 | 정성태 | 2/21/2017 | 28739 | 오류 유형: 378. A 64-bit test cannot run in a 32-bit process. Specify platform as X64 to force test run in X64 mode on X64 machine. | |
| 11148 | 정성태 | 2/20/2017 | 27919 | .NET Framework: 644. AppDomain에 대한 단위 테스트 시 알아야 할 사항 | |
| 11147 | 정성태 | 2/19/2017 | 25216 | 오류 유형: 377. Windows 10에서 Fake 어셈블리를 생성하는 경우 빌드 시 The type or namespace name '...' does not exist in the namespace 컴파일 오류 발생 | |
| 11146 | 정성태 | 2/19/2017 | 25989 | 오류 유형: 376. Error VSP1033: The file '...' does not contain a recognized executable image. [2] | |
| 11145 | 정성태 | 2/16/2017 | 28135 | .NET Framework: 643. 작업자 프로세스(w3wp.exe)가 재시작되는 시점을 알 수 있는 방법 - 두 번째 이야기 [4] | 1 |
| 11144 | 정성태 | 2/6/2017 | 30991 | .NET Framework: 642. C# 개발자를 위한 Win32 DLL export 함수의 호출 규약 (부록 1) - CallingConvention.StdCall, CallingConvention.Cdecl에 상관없이 왜 호출이 잘 될까요? | 1 |
| 11143 | 정성태 | 2/5/2017 | 29799 | .NET Framework: 641. [Out] 형식의 int * 인자를 가진 함수에 대한 P/Invoke 호출 방법 | 1 |
| 11142 | 정성태 | 2/5/2017 | 36308 | .NET Framework: 640. 닷넷 - 배열 크기의 한계 [2] | 1 |
| 11141 | 정성태 | 1/31/2017 | 31459 | .NET Framework: 639. C# 개발자를 위한 Win32 DLL export 함수의 호출 규약 (4) - CLR JIT 컴파일러의 P/Invoke 호출 규약 [1] | 1 |