Visual Studio 类向导 - 无法检索对话框的控件

问题描述 投票:0回答:1

如果我尝试在 Visual Studio 2019 中运行某些对话框的类向导,则会显示错误“无法检索对话框‘IDD.....’的控件。但是在类向导打开并正常工作后。 但我很有趣,为什么它会抛出这个错误。

Dialog是从我自己的类继承的,而不是从

CDialogEx
继承的。但我自己的类是继承自
CDialogEx

我的对话框类代码:

#pragma once
#include "resource.h"
#include "CMjAcDialog.h"

// CMjcDlgVyberTrasu dialog

class CMjcDlgVyberTrasu : public CMjAcDialog
{
    DECLARE_DYNAMIC(CMjcDlgVyberTrasu)

public:
    CMjcDlgVyberTrasu(CWnd* pParent = nullptr);   // standard constructor
    virtual ~CMjcDlgVyberTrasu();

// Dialog Data
#ifdef AFX_DESIGN_TIME
    enum { IDD = IDD_VYBER_TRASU };
#endif

protected:
    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    vector<CMajTrasa *> *m_pVecOfTrasy;
    CListCtrl m_cList;

    DECLARE_MESSAGE_MAP()
public:
    afx_msg void OnBnClickedBtUkaz();
    virtual BOOL OnInitDialog();
};

以及我的对话类

CMjAcDialog
代码的一部分:

class CMjAcDialog : public CDialogEx

{
    DECLARE_DYNAMIC(CMjAcDialog)

protected:
    UINT m_IDD;
    CMajCtrlMap m_majCtrlMap;
    CFont m_Font_mid, m_Font_big;
    CString m_csDlgTitle;
    HICON m_hIcon;

private:
    int m_idMainIcon;
    float m_dCurDpiScale;

// konstruktor
public:
    CMjAcDialog(UINT idd, CWnd* pParent = NULL, CString acsWinCaption = L"", int idMainIcon = 0);
    ~CMjAcDialog();

protected:
    virtual BOOL OnInitDialog();
.....
....
c++ mfc visual-studio-2019 classwizard
1个回答
0
投票

删除 .aps 后在我的案例中起作用 11 个月后才评论,但下一次搜索可能会找到它。 祝你好运!

© www.soinside.com 2019 - 2024. All rights reserved.