|
-
May 28th, 2004, 11:07 PM
#1
It can not print and print preview!!
see my code first.
pDocTemplate = new CMultiDocTemplate(
IDR_FINALTTYPE,
RUNTIME_CLASS(CFinalTDoc), //base CDocument
RUNTIME_CLASS(CChildFrame), //base CMDIChildWnd
RUNTIME_CLASS(CFinalTView)); //CListView
AddDocTemplate(pDocTemplate);
m_pTemplateTxt = new CMultiDocTemplate(
IDR_FINALTTYPE,
RUNTIME_CLASS(CCdoc), //base CDocument
RUNTIME_CLASS(CChildFrame), // base CMDIChildWnd
RUNTIME_CLASS(CTextView)); //base CView
m_pTemplateTab = new CMultiDocTemplate(
IDR_FINALTTYPE,
RUNTIME_CLASS(CFinalTDoc), //base CDocument
RUNTIME_CLASS(CChildFrame), //base CMDIChildWnd
RUNTIME_CLASS(CFinalTView)); //base CView
i define two functions to create VIEW-DOCUMENT-FRAME
structure
CDocument* CMainFrame::CreateDocTxt()
{
CFinalTApp* myapp =(CFinalTApp* )AfxGetApp();
CDocument* pDoc=(CDocument* )
myapp->m_pTemplateTxt->OpenDocumentFile(NULL);
return pDoc;
}
CDocument* CMainFrame::CreateDocTab()
{
CFinalTApp* myapp =(CFinalTApp* )AfxGetApp();
CDocument* pDoc=(CDocument* )
myapp->m_pTemplateTab->OpenDocumentFile(NULL);
return pDoc;
}
I use just one menu IDR_FINALTTYPE.
why the view i use "CreateDocTab()" to create has the print and print preview ,but the view i use CreateDocTxt() to create does not have?
i have defined the follow functions in both view?
CXXXView::OnDraw()
void CXXXView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
BOOL CXXXView::OnPreparePrinting(CPrintInfo* pInfo)
void CXXXView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
void CXXXView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|