0

尝试使用 Visual Studio 2008 构建软件电话源 (microsip),但未识别 ​​windows 跳转列表类。

第 19 行给出了一个错误,因为ICustomDestinationList没有被识别

c:\users\gremblin\downloads\microsip-3.9.2-src\microsip-3.9.2-src\jumplist.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"

4

1 回答 1

1

shobjidl.h仅定义ICustomDestinationListwhen ,因此如果未设置为 Windows 7 或更高版本NTDDI_VERSION >= NTDDI_WIN7,编译器会报错。NTDDI_VERSION

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 标头

于 2014-12-10T23:08:51.497 回答