我有一个 Visual Studio 2015 项目,它使用 afxcmn header 并且有很多“未定义”错误。
我在文档中读到这些数据类型包含在 commctrl.h 中,它已作为外部依赖项包含在 Visual Studio 项目中。
// Adds a group to the control.
AFX_ANSI_DEPRECATED int InsertGroup(_In_ int index, _In_ PLVGROUP pgrp);
// Sets information about the specified group (by ID) in the control.
AFX_ANSI_DEPRECATED int SetGroupInfo(_In_ int iGroupId, _In_ PLVGROUP pGroup);
// Retrieves information for the specified group in the control.
AFX_ANSI_DEPRECATED int GetGroupInfo(_In_ int iGroupId, _Out_ PLVGROUP pgrp) const;
这是给出这些错误的 afxcmn.h 的一些代码示例。
我不知道我是否必须在项目中配置其他东西以包含 commctrl header
最佳答案
是的,PLVGROUP是在commctrl.h中定义的,但是它依赖于WINVER
#if (NTDDI_VERSION >= NTDDI_WINXP)
这意味着 WINVER >= 501,请参阅:
error-Direktive: MFC 不支持小于 0x0501 的 WINVER。请在您的项目属性或预编译头文件中更改 WINVER 的定义。
所以我不得不改变我的stdafx.h
//#define 赢家 0x0500
#define WINVER NTDDI_WINXP//0x05010000
关于c++ - 标识符 "PLVGROUP"未定义 afxcmn.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36199415/