C++未识别 Windows 跳转列表类
C++ Windows jumplist classes are not being identified
尝试使用 Visual Studio 2008 构建软件电话源 (microsip),但未识别 windows 跳转列表类。
第 19 行出现错误,因为无法识别ICustomDestinationList
c:usersgremblindownloadsmicrosip-3.9.2-srcmicrosip-3.9.2-srcjumplist.h(19)
: error C2143: syntax error : missing ';' before '*'
1. #ifndef jumplist_h__
2. #define jumplist_h__
3.
4. #include <string>
5. #include <shobjidl.h>
6. #include <propkey.h>
7. #include <propvarutil.h>
8.
9. class JumpList
10. {
11. public:
12. JumpList(std::wstring AppID);
13. ~JumpList();
14. bool DeleteJumpList();
15. void AddTasks();
16.
17. private:
18. HRESULT _CreateShellLink(PCWSTR pszArguments, PCWSTR pszTitle, IShellLinkW **ppsl, int iconindex = -1);
19. ICustomDestinationList *pcdl;
20. };
#endif // jumplist_h__
我错过了什么吗?据我所知jumplist
功能都在"shobjidl.h"
shobjidl.h
仅在NTDDI_VERSION >= NTDDI_WIN7
时定义ICustomDestinationList
,因此如果NTDDI_VERSION
未设置为Windows 7或更高版本,编译器将进行投诉。
默认情况下NTDDI_VERSION
在 sdkddkver.h
中定义:
#define NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
...
#if !defined(_WIN32_WINNT) && !defined(_CHICAGO_)
#define _WIN32_WINNT 0x0601
#endif
#ifndef NTDDI_VERSION
#ifdef _WIN32_WINNT
// set NTDDI_VERSION based on _WIN32_WINNT
#define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
#else
#define NTDDI_VERSION 0x06010000
#endif
#endif
因此,要么在项目中定义自己NTDDI_VERSION
,要么将_WIN32_WINNT
定义为适当的值并让它传播到NTDDI_VERSION
。
请参阅 MSDN,了解_WIN32_WINNT
与NTDDI_VERSION
的关系:
使用 Windows 标头
相关文章:
- Windows 10 上已安装应用的列表
- 如何在 Windows 上获取带有 c++ 且没有 <dirent.h> 的特定扩展名的所有文件的列表
- 如何在Windows Media Foundation SDK中指定语言列表对象
- Windows Visual Studio C++列表列表
- C++ Win32 列表框和滑块创建 Windows 应用程序
- 如何在基于 Windows 8 Xaml 的列表视图中禁用缓存
- C 链接列表仅在GNU/Linux而非Windows中导致分割故障
- 如何在Windows中为当前用户获取库文件夹列表
- Windows 通用应用 (XAML):不能使用给定的参数列表调用文本块>文本
- 如何获取特定进程 (Windows 7) 使用的所有 API 的列表
- 如何获取在 Windows 7 中安装的主题列表(主题名称)
- 什么是 Windows 内存管理中的待机列表
- C++未识别 Windows 跳转列表类
- 如何在 Windows 8 中更改语言列表顺序
- 在C++中检索Windows中的菜单项列表
- 如何在设备管理器Windows-c++中获得带有黄色感叹号的设备列表
- 如何在Windows平台中获取远程Windows服务器的共享文件夹的文件列表
- Windows中的麦克风列表(输入设备列表)
- QT C++-如何在播放列表处于活动状态的情况下打开Windows Media Player
- 如何获取绑定到我正在运行的控制台窗口的进程列表,这些进程也可以在 Windows 2000 中工作?