visual-c++ - 编译器错误 C2664

标签 visual-c++ mfc compiler-errors

遇到这个编译器错误的问题,我不知道它在提示什么。如果有人可以提供帮助,我将不胜感激。这是错误:

Error   1   error C2664: 'CPropertyPage::CPropertyPage(UINT,UINT,DWORD)' : cannot convert parameter 2 from 'CWnd *' to 'UINT'   c:\users\bnason.prolec\documents\visual studio 2005\projects\autorepair1\autorepair1\customerinformationdlg.cpp 20

这是似乎导致它的代码:
CRepairOrderSheet::CRepairOrderSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
    :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
        this->AddPage(&dlgCustomerInformation);
        this->AddPage(&dlgJobsAndParts);
        this->AddPage(&dlgRepairSummary);

}

最佳答案

CPropertyPage构造函数接受三个参数:UINT , UINT , 和 DWORD .不清楚您的CRepairOrderSheet源自 CPropertyPageCPropertySheet (未提供相关信息),但编译器认为您正在尝试构建 CPropertyPage .你正在通过它LPCTSTR , CWnd*UINT .编译器无法获得匹配的类型。

关于visual-c++ - 编译器错误 C2664,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8012504/

相关文章:

c++ - 尝试编译我的wxWidgets程序时出现 “is_enum not declared in this scope”错误

c++ - 在 Windows 关机时保存数据

visual-c++ - 在 VS2013 中针对 .Net 4.6 的某些项目的项目加载失败

c++ - 获取套接字功能的连接超时

c++ - Win32 C++ 在运行时为 MenuItem 分配/更改快捷键

java - 缺少返回语句java

c - 转换 void* 缓冲区时无效使用 void 表达式

c++ - 如何在不使用对象的情况下连接字符串、整数和 float ?

c++ - 如果未选中任何项目,则禁用某些上下文菜单项

C++ 32 位应用程序试图使用 64 位 MFC DLL