先后声明建立CDIgadd,CDIgall类。然后使用class向导,添加相应函数,通过
void CBAWADlg::OnMenuAdd()
{
// TODO: Add your command handler code here
CDIgadd dIg;
dIg.DoModal();
}void CBAWADlg::OnMenuAll()
{
// TODO: Add your command handler code here
CDIgall dIg;
dIg.DoModal();
}
使它输出相应对话框
老出错
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2065: 'CDIgadd' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2146: syntax error : missing ';' before identifier 'dIg'
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2065: 'dIg' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(187) : error C2228: left of '.DoModal' must have class/struct/union type
E:\vc\复件 bawa3.2\BAWADlg.cpp(193) : error C2065: 'CDIgall' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(193) : error C2146: syntax error : missing ';' before identifier 'dIg'
E:\vc\复件 bawa3.2\BAWADlg.cpp(194) : error C2228: left of '.DoModal' must have class/struct/union type
Error executing cl.exe.BAWA.exe - 7 error(s), 0 warning(s)
void CBAWADlg::OnMenuAdd()
{
// TODO: Add your command handler code here
CDIgadd dIg;
dIg.DoModal();
}void CBAWADlg::OnMenuAll()
{
// TODO: Add your command handler code here
CDIgall dIg;
dIg.DoModal();
}
使它输出相应对话框
老出错
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2065: 'CDIgadd' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2146: syntax error : missing ';' before identifier 'dIg'
E:\vc\复件 bawa3.2\BAWADlg.cpp(186) : error C2065: 'dIg' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(187) : error C2228: left of '.DoModal' must have class/struct/union type
E:\vc\复件 bawa3.2\BAWADlg.cpp(193) : error C2065: 'CDIgall' : undeclared identifier
E:\vc\复件 bawa3.2\BAWADlg.cpp(193) : error C2146: syntax error : missing ';' before identifier 'dIg'
E:\vc\复件 bawa3.2\BAWADlg.cpp(194) : error C2228: left of '.DoModal' must have class/struct/union type
Error executing cl.exe.BAWA.exe - 7 error(s), 0 warning(s)
删除 关工程 删clw 等文件 打开工程 重建clw
再添加函数
这样是不能用的
#include "DIgall.h"
#include "DIgadd.h"#include "stdafx.h"这样就好了
#include "stdafx.h"#include "DIgall.h"
#include "DIgadd.h"