class CTestGridView : public CCtrlView
{
// ...
CGridCtrl& GetGridCtrl() const {return *(CGridCtrl*)this;} // <--bad
// ...
}
It crashes because neither CCtrlView nor CTestGridView has a SetRowCount method.
You tried to apply a "trick" used in another CCtrlView-derived classes. It works there because the control classes (CListCtrl, CTreeCtrl, etc.) has methods that only send messages. Example:
So, I should understand that I cannot use CGridCtrl inside of CCtrlView in this way ...
I am using right now this technique, to resize an CGridCtrl object over a CView, but I have met a little bug in this case: when I have CDockablePane on an CChildFrame, and CGridCtrl over CView, because CChildFrame are somehow restored under CGridCtrl ... , yes, this is weird, and this happen even if all child frames are maximized, I could switch between open child frames, as I said before, because some CChildFrame are restored ... I know, it is strange, but this is sort of difficult to reproduce this bug ... I will try to made a test app that illustrate this behavior ...
I would like to use the solution from the first post, but I guess it is impossible ...
I will come back with another test app. Thank you.
Last edited by mesajflaviu; February 21st, 2018 at 10:32 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.