我创建一个SDI,命名为test,在最后一步改为CFormView,,,添加一个对话框,并生成类c1,
在c1.cpp,包含testview.h,如下:
#include "stdafx.h"
#include "test.h"
#include "c1.h"
#include "testview.h"
出错如下:
Compiling...
c1.cpp
d:\test\testview.h(27) : error C2143: syntax error : missing ';' before '*'
d:\test\testview.h(27) : error C2501: 'CTestDoc' : missing storage-class or type specifiers
d:\test\testview.h(27) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Error executing cl.exe.
为什么不能包含呀?但是在testview.cpp中包含test.h却可以,这是大家都知道的我想在对话框中调用视类(CTestView)的成员变量(自己定义的),最好怎么作,假设这个变量是int n,代码怎么写
在c1.cpp,包含testview.h,如下:
#include "stdafx.h"
#include "test.h"
#include "c1.h"
#include "testview.h"
出错如下:
Compiling...
c1.cpp
d:\test\testview.h(27) : error C2143: syntax error : missing ';' before '*'
d:\test\testview.h(27) : error C2501: 'CTestDoc' : missing storage-class or type specifiers
d:\test\testview.h(27) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Error executing cl.exe.
为什么不能包含呀?但是在testview.cpp中包含test.h却可以,这是大家都知道的我想在对话框中调用视类(CTestView)的成员变量(自己定义的),最好怎么作,假设这个变量是int n,代码怎么写
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货