Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Doing print abort with a toolbar button

Doing print abort with a toolbar button

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CodeBrain
    wrote on last edited by
    #1

    I have a printing application which works quite good for some years now. It uses a modless abort dialog which can be used to abort the banded printing process. The dialog uses the well known "keep the message pump alive" method which is e.g. described in this article (http://www.codeproject.com/threads/TemplatedLengthyOperation.asp[^]. So the printing process queries an abort method of the dialog continuously which keeps the message handling alive and checks the abort button. This works very good for years now. But now I want to use a progress bar and an abort button in the toolbar of the print preview view instead of the dialog - but I am not sure if this will work with the same technique like in the abort dialog. I could not find any information about it. Everyone seems to use a dialog. Has anyone an idea if this works?

    L 1 Reply Last reply
    0
    • C CodeBrain

      I have a printing application which works quite good for some years now. It uses a modless abort dialog which can be used to abort the banded printing process. The dialog uses the well known "keep the message pump alive" method which is e.g. described in this article (http://www.codeproject.com/threads/TemplatedLengthyOperation.asp[^]. So the printing process queries an abort method of the dialog continuously which keeps the message handling alive and checks the abort button. This works very good for years now. But now I want to use a progress bar and an abort button in the toolbar of the print preview view instead of the dialog - but I am not sure if this will work with the same technique like in the abort dialog. I could not find any information about it. Everyone seems to use a dialog. Has anyone an idea if this works?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      Printing in a background thread and when the UI thread tool button is clicked us PostThreadMessage to inform the printing thread of the abort.

      C 1 Reply Last reply
      0
      • L led mike

        Printing in a background thread and when the UI thread tool button is clicked us PostThreadMessage to inform the printing thread of the abort.

        C Offline
        C Offline
        CodeBrain
        wrote on last edited by
        #3

        Thanks for your answer. Of course this would work, but I try not to change how the internal printing routine work. So want to avoid using a thread if it is possible.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups