在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的頭文件。