從Frame類中訪問View類中的變量?

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章