CDlgInput2 inputDlg1; ar<<inputDlg1.m_Age_Edit; ar<<inputDlg1.m_Name_Edit; ar<<inputDlg1.m_Sex_Radio;这一段哪里不对
时间: 2024-03-24 12:36:13 浏览: 24
这段代码的问题在于CDlgInput2类未被正确声明或定义。你需要确保在使用CDlgInput2类之前已经正确地包含了它的头文件,或者在该文件中定义了该类。
另外,如果你想要用CArchive对象(ar)序列化CDlgInput2类的成员变量,你需要在CDlgInput2类的定义中添加Serialize函数,例如:
```
class CDlgInput2 : public CDialog
{
DECLARE_SERIAL(CDlgInput2)
public:
// 其他成员函数和变量声明
void Serialize(CArchive& ar)
{
CDialog::Serialize(ar);
ar << m_Age_Edit;
ar << m_Name_Edit;
ar << m_Sex_Radio;
}
private:
// 成员变量声明
};
```
这样,你就可以用Serialize函数来序列化CDlgInput2类的成员变量了。
相关问题
error C2065: 'CDlgInput2' : undeclared identifier C:\Users\张琳\Desktop\MyMdi\MyMdiDoc3.cpp(90) : error C2146: syntax error : missing ';' before identifier 'inputDlg1' C:\Users\张琳\Desktop\MyMdi\MyMdiDoc3.cpp(90) : error C2065: 'inputDlg1' : undeclared identifier C:\Users\张琳\Desktop\MyMdi\MyMdiDoc3.cpp(91) : error C2228: left of '.m_Age_Edit' must have class/struct/union type C:\Users\张琳\Desktop\MyMdi\MyMdiDoc3.cpp(92) : error C2228: left of '.m_Name_Edit' must have class/struct/union type C:\Users\张琳\Desktop\MyMdi\MyMdiDoc3.cpp(93) : error C2228: left of '.m_Sex_Radio' must have class/struct/union type MyMdiView3.cpp
这是一个编译错误,包含多个错误。其中,第一个错误提示使用了未声明的标识符“CDlgInput2”,可能的原因是没有包含定义该标识符的头文件。
另外几个错误提示语法错误和未声明的标识符,可能的原因包括:
1. 缺少分号或者其他符号导致语法错误。
2. 没有声明或定义变量导致未声明的标识符错误。
解决该错误的方法包括:
1. 确保包含了定义该标识符的头文件。
2. 检查代码中缺少分号或者其他符号导致的语法错误。
3. 检查代码中声明或定义变量是否正确、完整。
4. 确认变量的类型是否正确,如果不正确则需要进行类型转换。
5. 检查代码中变量名的拼写和使用是否正确。
input_const = inputdlg(prompt, title, dims, definput);是什么意思
这行代码是MATLAB编程语言中的一个函数调用,用于创建一个用于接收用户输入的对话框。具体来说,它会显示一个包含prompt指定的提示信息、title指定的对话框标题和dims指定的对话框大小的对话框,并在其中显示一个文本框,用于接收用户输入。definput参数可以用于指定默认的输入值。最终,该函数将返回用户在对话框中输入的值,以字符串数组的形式返回。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)