创建新的类实例时发生错误

时间:2018-04-27 21:29:54

标签: c++ object

首先,请查看以下代码:

settingsFrm_generator类

class settingsFrm_generator : public Dialog {
    public:
        settingsFrm_generator(window* parent, const string& title = EmptyString, const Point& pos = DefaultPosition, const Size& size = Size( 359,298 ), long style = DEFAULT_DIALOG_STYLE ); 
        ~settingsFrm_generator();
};

settingsFrm class

class settingsFrm : public settingsFrm_generator {
public:
    settingsFrm() = default;
    settingsFrm(window *parent, const string &title);
    TextCtrl* getKeywordsTxt();
    ~settingsFrm();
protected:
    void ok_btn_Click(CommandEvent &event);
    void cancel_btn_Click(CommandEvent &event);
};

创建如下所示的实例时:

settingsFrm setting;  // (1) or
settingsFrm *setting = new settingsFrm; // (2)

此错误消息显示为Error C2280 'settingsFrm::settingsFrm(void)': attempting to reference a deleted function

请注意,它无法更改settingsFrm_generator类中的任何内容,因为它会自动生成。

为什么会这样,我该如何解决?

0 个答案:

没有答案