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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Parent repainting problem

Parent repainting problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • P Offline
    P Offline
    Phil Benson
    wrote on last edited by
    #1

    I have a modal dialog doing lengthing processing, and if the parent window (Form/View app) loses focus, the Parent window is not repainted, and only the animation control on the dialog is repainted. I´ve tried to avoid this using sleep(0), but to no effect. Has anyone any ideas? Thanks phil bum... and I thought I´d got rid of all the bugs :(

    Who the F*** is general failure and why is he reading my hard drive?

    J 1 Reply Last reply
    0
    • P Phil Benson

      I have a modal dialog doing lengthing processing, and if the parent window (Form/View app) loses focus, the Parent window is not repainted, and only the animation control on the dialog is repainted. I´ve tried to avoid this using sleep(0), but to no effect. Has anyone any ideas? Thanks phil bum... and I thought I´d got rid of all the bugs :(

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      You can move the lengthy process to a different thread, perhaps. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

      P 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        You can move the lengthy process to a different thread, perhaps. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

        P Offline
        P Offline
        Phil Benson
        wrote on last edited by
        #3

        The problem is I´m working with a Access database using DAO (MFC derived classes), and that is not thread safe. All I am doing is importing values from different tables from one DB to another.Dependent on the size of the data to import, this can take many minutes. I´m having to use do..while loops and this is obviously very CPU intensive. I´ve introduced sleep(0), to break the CPU usage a bit, but still have problems with the Main application painting. I´ve tried using GetParent()->RedrawWindow() from the Modal dialog, and funny enough, in the debug version this works, but when I compile in release, the modal dialog and the Main window are repainted, as long as no other window/app gets the focus. When I change back to my app, so that it has focus, both modal dialog and main app window are just plain white, and when the modal dialog gets focus, the task manager insists that it is not responding, but if I let it run, the task completes successfully. I´m no expert(as you can probably tell), but this has really got me stumped! bum... and I thought I´d got rid of all the bugs :(

        Who the F*** is general failure and why is he reading my hard drive?

        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