2011-10-13 77 views
1

我正在使用DirectX 9在Vs 2008/windows7上进行示例。 我收到错误消息。SHGetFolderPath':标识符未找到

1> ------构建开始:项目:VideoCapture,配置:Unicode的调试的Win32 ------ 1>编译...

1> VideoCaptureDlg.cpp
1> \ VideoCaptureDlg.cpp(169):错误C2065:SHGFP_TYPE_CURRENT':未声明的标识符
1> \ VideoCaptureDlg.cpp(169):错误C3861: '的SHGetFolderPath':标识符没有找到
1> \ VideoCaptureDlg.cpp (173):错误C2065:'SHGFP_TYPE_CURRENT':未声明的标识符
1>。\ VideoCaptureDlg.cpp(173):错误C3861:'SHGetFolderPath':标识符未找到 1>。\ VideoCaptureDlg.cpp(1025):Warning C4244:'argument':从'int'转换为'WORD',可能丢失数据
1>。\ VideoCaptureDlg.cpp(1180):error C2065: 'SHGFP_TYPE_CURRENT':未声明的标识符
1> \ VideoCaptureDlg.cpp(1180):错误C3861: '的SHGetFolderPath':错误C2065: 'SHGFP_TYPE_CURRENT':未找到
1> \ VideoCaptureDlg.cpp(1184)标识符未申报标识符
1> \ VideoCaptureDlg.cpp(1184):错误C3861: '的SHGetFolderPath':未找到

我已经加入SHLOBJ.H和SHELL32.LIB以及仍然是示出了相同的错误标识符。

我试图改变以下基于Windows 7和Internet Explorer 8中的stdafx.h文件中的宏的价值却是露出冲突“C1189:#错误:与_WIN32_IE设置_WIN32_WINNT设置冲突”

//参考MSDN获取有关不同平台相应值的最新信息。

#ifndef WINVER // Allow use of features specific to Windows XP or later.  
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.  
#endif  

#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.  
#define _WIN32_WINNT 0x0601 // Change this to the appropriate value to target other versions of Windows.  
#endif  

#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.  
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.  
#endif  

#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.  
#define _WIN32_IE 0x0800 // Change this to the appropriate value to target other versions of IE.  
#endif 

对此问题的任何建议都会有帮助。

+0

stdafx.h中是啊,我设立之前的任何包含文件 –

+0

感动评论基于什么触发错误回答。 – Richard

回答

0

该问题已解决问题。 我只是改变了预处理下,项目属性设置 - > C++ - >

之前,它是
_WINDOWS; WINVER =的0x0400; DEBUG; _DEBUG; _WIN32_WINNT = 0x400的; WIN32; UNICODE

我改成了
_WINDOWS; WINVER =为0x0600; DEBUG; _DEBUG; _WIN32_WINNT = 0x600; WIN32; UNICODE

2

是来自MSDN的代码块还是您的stdafx.h?我只是将宏设置为与条件无关(要覆盖以前的设置)。还要确保你在包含之前设置它们(特别是windows.h)。

望着错误消息来自(线sdkddkver.h 263),其中:

#if ((_WIN32_WINNT < _WIN32_WINNT_WIN2K) && (_WIN32_IE > _WIN32_IE_IE60SP1)) 
#error _WIN32_WINNT settings conflicts with _WIN32_IE setting 
#endif 

你觉得你的方式设置这些宏。

编辑(按评论):

我会开始stdafx.h文件(并确保是总是第一头;这是需要有效的预编译头以及):

#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 and max (prefer C++ lib) 
+0

看到我的问题是这个错误“错误C3861:'SHGetFolderPath':标识符未找到”。我搜索了网络,发现根据目标系统改变这些宏的值解决了问题。这就是为什么我改变了值,正在给冲突。对原始错误的任何建议 –

+0

更改宏*是解决原始错误的方法。 – Puppy

+0

@DeadMg宏将会有什么值.OS是Windows 7,IE是IE 8 –