CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Portugal
    Posts
    50

    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)?


  2. #2
    Join Date
    Jul 1999
    Location
    Moscow, Russia
    Posts
    667

    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
  •  





Click Here to Expand Forum to Full Width

Featured