在frame中访问view类中的变量时,需要在frame的cpp中加入view的头文件。但经常会出现以下错误:
1) myview.h(21) : error C2143: syntax error : missing ';' before '*'
2) myview.h(21) : error C2501: 'MyDoc' : missing storage-class or type specifiers
3) myview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
这个错误发生在view类的头文件中。
解决方法就是在view类的头文件中包含doc的头文件。