
Creating an View from dialog-based application.
Hi,
How do I create an view-output from within a simple function?
Ok, my goal is to print an html-file, so I thought I can load it into
a CHtmlView (maybe a class derrived from it) and use the
printing-stuff from CView::OnPrint()
I tried:
CDC dc;
CPrintDialog dlg;
if (dlg.DoModal() != IDOK) return;
dc.Attach(dlg.GetPrinterDC());
dc.StartDoc();
dc.StartPage();
// Initializing the Document
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDD_TESTPRINTHTML_DIALOG, // this is a dialog-resource... :-?
RUNTIME_CLASS(MyPrintDocument), // an clean, derrived CDocument
RUNTIME_CLASS(CFrameWnd), // just to specify something.
RUNTIME_CLASS(MyPrintView)); // an clean CView
Ok, so far so good, but how can I call the OnPrint() of my
"MyPrintView" ???
Hoping for help.
Immanuel Scholz