calling OnDraw()
-
Hallo, i have the following code: void CTest_MyDocumentDoc::Print_Output() { m_ptrOutput->Invalidate (true);// m_ptrOutput= (CRichEditView *) m_wndSplitter.GetPane(1,0); m_ptrOutput->UpdateWindow(); UpdateAllViews(NULL); } i have splitted SDI-appliction and i need to call OnDraw() indirectly to print / draw my results in the second part of my splitted sdi App., this code does not work , the OnDraw() does NOT be called ??
-
Hallo, i have the following code: void CTest_MyDocumentDoc::Print_Output() { m_ptrOutput->Invalidate (true);// m_ptrOutput= (CRichEditView *) m_wndSplitter.GetPane(1,0); m_ptrOutput->UpdateWindow(); UpdateAllViews(NULL); } i have splitted SDI-appliction and i need to call OnDraw() indirectly to print / draw my results in the second part of my splitted sdi App., this code does not work , the OnDraw() does NOT be called ??
Don't do it that way. Put your code to draw the window in a separate method and call that method from both OnDraw and Print_Output, passing a suitable DC in both cases. So, if you call it "DrawView", OnDraw would call DrawView, as would Print_Output.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
Don't do it that way. Put your code to draw the window in a separate method and call that method from both OnDraw and Print_Output, passing a suitable DC in both cases. So, if you call it "DrawView", OnDraw would call DrawView, as would Print_Output.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
i tried to do it that way before, but i did not have any text drawen on the monitor, i am forced to do it that way, and how can i get a suitable DC ? please explain in code . thanks
susanne1 wrote:
a suitable DC
OnDraw[^] gives you a screen DC CPrintDialog/CPrintDialogEx can be used to create printer DCs, if you aren't going to follow the standard MFC printing mechanisms. So in each case, you have a way of calling your 'draw' code with a suitable DC.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p