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

    Printing and multithreading

    Anyone ever try - or have a suggestion - how to pass the printing off as a thread in an MFC application? When I surround an OnFilePrint as a thread, it bombs when the "viewprint.cpp-OnFilePrint" tries to initiate the CPrintingDialog?

    Any suggestions how to do it differently or how to resolve the problem?

    Thank you in advance

    Sharon

  2. #2
    Join Date
    Jun 2004
    Posts
    1,352

    Re: Printing and multithreading

    Post some code, how does it bomb and where???

    Are you trying to Preview??

  3. #3
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    14

    Re: Printing and multithreading

    Actually after more research and investigation I discovered that you cannot gain access to the mainframe through a thread and if printing is in a thread - the MFC code automatically goes through logic that gets to the CView and Mainframe and these things are not in the map table of the thread and so in an ASSERTVALID the program bombs.

    Is there any way to use the default MFC printing and allow the actually waiting for the printing to b in a thread? Is there a better approach?

    Sharon

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