c++ - SHGetFolderPath': identifier not found -
i doing sample using directx 9 on vs 2008/windows7. getting error.
1>------ build started: project: videocapture, configuration: debug unicode win32 ------ 1>compiling...
1>videocapturedlg.cpp
1>.\videocapturedlg.cpp(169) : error c2065: 'shgfp_type_current' : undeclared identifier
1>.\videocapturedlg.cpp(169) : error c3861: 'shgetfolderpath': identifier not found
1>.\videocapturedlg.cpp(173) : error c2065: 'shgfp_type_current' : undeclared identifier
1>.\videocapturedlg.cpp(173) : error c3861: 'shgetfolderpath': identifier not found
1>.\videocapturedlg.cpp(1025) : warning c4244: 'argument' : conversion 'int' 'word', possible loss of data
1>.\videocapturedlg.cpp(1180) : error c2065: 'shgfp_type_current' : undeclared identifier
1>.\videocapturedlg.cpp(1180) : error c3861: 'shgetfolderpath': identifier not found
1>.\videocapturedlg.cpp(1184) : error c2065: 'shgfp_type_current' : undeclared identifier
1>.\videocapturedlg.cpp(1184) : error c3861: 'shgetfolderpath': identifier not found
i have added shlobj.h , shell32.lib still showing same error.
i tried changing value of following macro in stdafx.h file based on windows 7 , internet explorer 8 showing conflict "c1189: #error : _win32_winnt settings conflicts _win32_ie setting"
// refer msdn latest info on corresponding values different platforms.
#ifndef winver // allow use of features specific windows xp or later. #define winver 0x0501 // change appropriate value target other versions of windows. #endif #ifndef _win32_winnt // allow use of features specific windows xp or later. #define _win32_winnt 0x0601 // change appropriate value target other versions of windows. #endif #ifndef _win32_windows // allow use of features specific windows 98 or later. #define _win32_windows 0x0410 // change appropriate value target windows me or later. #endif #ifndef _win32_ie // allow use of features specific ie 6.0 or later. #define _win32_ie 0x0800 // change appropriate value target other versions of ie. #endif
any suggestion issue helpfull.
is code block msdn or stdafx.h
? set macros no messing conditionals (you want override previous settings). ensure setting them before includes (especially windows.h
).
looking @ error message comes (line 263 of sdkddkver.h
):
#if ((_win32_winnt < _win32_winnt_win2k) && (_win32_ie > _win32_ie_ie60sp1)) #error _win32_winnt settings conflicts _win32_ie setting #endif
you not setting these macros in way think are.
edit (as per comments):
i start stdafx.h
file (and ensure always first header; needed effective pre-compiled headers well):
#define winver 0x0601 // kernel 6.1 == windows 7/server 2008 r2 #define _win32_winnt winver #define _win32_ie 0x0800 // ie8 #define nominmax // don't define min , max (prefer c++ lib)
Comments
Post a Comment