|
-
September 14th, 1999, 12:33 PM
#1
Docs and Threads
I have an MDI app and need to use one of its docs in another thread for background printing. I only need the doc, not the view as the printing should be invisible for the user.
Is there a way to create the doc inside the thread (a worker thread)?
-
September 15th, 1999, 03:20 AM
#2
Re: Docs and Threads
Try this:
1. To open existing document:
CRuntimeClass * pClass=RUNTIME_CLASS(CYourDoc);
CYourDoc* pDoc= (CYourDoc*)pClass->CreateObject();
pDocument->m_bEmbedded = TRUE; // avoid creating temporary compound file
pDoc->OnOpenDocument("FileName.foo");
2. To create new empty document:
CRuntimeClass * pClass=RUNTIME_CLASS(CYourDoc);
CYourDoc* pDoc= (CYourDoc*)pClass->CreateObject();
pDocument->m_bEmbedded = TRUE; // avoid creating temporary compound file
pDoc->OnNewDocument();
Let me know if it helps.
Good luck,
Oleg.
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
|