Re: How to update the view?
Try Invalidate()( pView = pointer to current CVpsView) .
May be you can move inputParameters() to CVpsView?
BOOL CMainFrame::inputParameters()
{
// input data dialog
pView->Invalidate();
}
Good Luck!
Re: How to update the view?
It still doesn't work. This project was created by Appwizard. The data input and drawing never involve in the Document. is this the reason?
Before I finish the data input, I don't want to open the view. This is why I put inputparameters() under MainFrame.
I'm not really understand the mechanism of updating view. under what conditions it will refresh? could you give me some more explains?
regards
zhiwen
Re: How to update the view?
Hi, zhiwen!
I think MSDN will explain this more better than me , becouse I have very baaad english.
I don't now what reason, becouse may be something wrong in the other code.
But my small test with your code works.
I use OnPaint() instead OnDraw(), but think, it does not matter
If you want , you can send me more code details to [email protected] (attach code)
Good luck!
void CTtestView::OnPaint()
{
CPaintDC dc(this);
OnPrepareDC(&dc);
CMainFrame* pf = (CMainFrame*)AfxGetMainWnd();
CString str = pf->m_drawingData();
int sv = dc.SaveDC();
CRect rect;
dc.SetTextColor(RGB(255,0,0));
dc.SetBkColor(::GetSysColor(COLOR_WINDOW));
GetClientRect(rect);
dc.DrawText(str, -1, rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
dc.RestoreDC(sv);
}