Notification for the end of Printing and Print Preview of the CHtmlView and derived Classes

可紊 提交于 2019-12-25 07:08:55

问题


How the Print and Print Preview ending notifications are done in the CHtmlView class?

Normal CView related classes have the OnEndPreview() and OnEndPrinting() evnets that were called by the framework itself and we can override them for the appropriate context.

void CMyHtmlView::OnFilePrintPreview()
{   
    // Before this I will call a Function Generate a HTML File in a Location and Updated in m_sFileName
    Navigate2(m_sFileName);
    ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, NULL, NULL );
}


void CMyHtmlView::OnFilePrint()
{
    // Before this I will call a Function Generate a HTML File in a Location and Updated in m_sFileName
    Navigate2(m_sFileName,NULL,NULL);
    CHtmlView::OnFilePrint();
}

On adding the OnEndPrintPreview() and OnEndPrinting() to the above code is never getting hit on the End functions :(

Is there any way round?

EDIT 1: I now also trapped into the problem of not getting focus for the Parent Window, from where the Print Preview been generated, after the Print Preview through ExecWB closed.

Please help me.. :(

来源:https://stackoverflow.com/questions/23293786/notification-for-the-end-of-printing-and-print-preview-of-the-chtmlview-and-deri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!