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. Program hangs when focused...

Program hangs when focused...

Scheduled Pinned Locked Moved C / C++ / MFC
c++helplounge
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.
  • T Offline
    T Offline
    the_augy
    wrote on last edited by
    #1

    I have a dialog-based MFC application. I create a prop sheet, add some pages to it, and display it. Everything works fine at first, but if I move focus away from the dialog (like alt-tabbing to another window or clicking on another window), if I try to view my application again it hangs. However, it will ONLY hang if I interact with the prop sheet (tab control) window. I play around all I want with dialog controls that aren't in the prop sheet or its prop pages, but the minute I touch anything having to do with the prop sheet, the dialog will hang in the manner I just described. Some other random things I've noticed: 1) If I do anything with the prop sheet (even something as simple as switch tabs), then move focus back to the main dialog by clicking one of the non-propsheet controls, the program will still hang when it gets focus back. 2) The program works perfectly fine while as long as it has focus. It's just when I switch to another window and then return that it hangs. 3) If I hit break in VC++6 while the program is hung, 99% of the time the message that my window is attempting to handle is WM_ACTIVATE (surprise surprise). Here's my main dialog's OnInitDialog function: // make our tab control m_PropSheet = new CPropertySheet("Project Manager"); m_ThreadProperties = new ThreadPropertiesPage; m_PropSheet->AddPage(m_ThreadProperties); m_TestSpec = new TestSpecificationPage; m_PropSheet->AddPage(m_TestSpec); m_MapProts = new MapPrototypes; m_PropSheet->AddPage(m_MapProts); m_PersistPage = new PersistPage; m_PropSheet->AddPage(m_PersistPage); m_ProjViewPage = new ProjectViewPage; m_PropSheet->AddPage(m_ProjViewPage); m_ProjViewPage->SetPMDlg(this); m_PropSheet->Create(this,WS_CHILD,NULL); m_PropSheet->SetWindowPos(NULL,10,27, 750,300,NULL); m_PropSheet->ShowWindow(TRUE); Nothin' much there. Thanks much for your help.

    T B 2 Replies Last reply
    0
    • T the_augy

      I have a dialog-based MFC application. I create a prop sheet, add some pages to it, and display it. Everything works fine at first, but if I move focus away from the dialog (like alt-tabbing to another window or clicking on another window), if I try to view my application again it hangs. However, it will ONLY hang if I interact with the prop sheet (tab control) window. I play around all I want with dialog controls that aren't in the prop sheet or its prop pages, but the minute I touch anything having to do with the prop sheet, the dialog will hang in the manner I just described. Some other random things I've noticed: 1) If I do anything with the prop sheet (even something as simple as switch tabs), then move focus back to the main dialog by clicking one of the non-propsheet controls, the program will still hang when it gets focus back. 2) The program works perfectly fine while as long as it has focus. It's just when I switch to another window and then return that it hangs. 3) If I hit break in VC++6 while the program is hung, 99% of the time the message that my window is attempting to handle is WM_ACTIVATE (surprise surprise). Here's my main dialog's OnInitDialog function: // make our tab control m_PropSheet = new CPropertySheet("Project Manager"); m_ThreadProperties = new ThreadPropertiesPage; m_PropSheet->AddPage(m_ThreadProperties); m_TestSpec = new TestSpecificationPage; m_PropSheet->AddPage(m_TestSpec); m_MapProts = new MapPrototypes; m_PropSheet->AddPage(m_MapProts); m_PersistPage = new PersistPage; m_PropSheet->AddPage(m_PersistPage); m_ProjViewPage = new ProjectViewPage; m_PropSheet->AddPage(m_ProjViewPage); m_ProjViewPage->SetPMDlg(this); m_PropSheet->Create(this,WS_CHILD,NULL); m_PropSheet->SetWindowPos(NULL,10,27, 750,300,NULL); m_PropSheet->ShowWindow(TRUE); Nothin' much there. Thanks much for your help.

      T Offline
      T Offline
      the_augy
      wrote on last edited by
      #2

      Well, I've found that the dialog WILL in fact refresh itself if there's something new to display. For instance, if I'm debugging in visual studio, and I insert a breakpoint before a statement that does something to one of the controls in a property page (like,say, add a string to a listbox), the dialog refreshes itself without any problems. But if I'm debugging and I look at my source code and then try to look back at the window, I get the hang I was talking about before.

      1 Reply Last reply
      0
      • T the_augy

        I have a dialog-based MFC application. I create a prop sheet, add some pages to it, and display it. Everything works fine at first, but if I move focus away from the dialog (like alt-tabbing to another window or clicking on another window), if I try to view my application again it hangs. However, it will ONLY hang if I interact with the prop sheet (tab control) window. I play around all I want with dialog controls that aren't in the prop sheet or its prop pages, but the minute I touch anything having to do with the prop sheet, the dialog will hang in the manner I just described. Some other random things I've noticed: 1) If I do anything with the prop sheet (even something as simple as switch tabs), then move focus back to the main dialog by clicking one of the non-propsheet controls, the program will still hang when it gets focus back. 2) The program works perfectly fine while as long as it has focus. It's just when I switch to another window and then return that it hangs. 3) If I hit break in VC++6 while the program is hung, 99% of the time the message that my window is attempting to handle is WM_ACTIVATE (surprise surprise). Here's my main dialog's OnInitDialog function: // make our tab control m_PropSheet = new CPropertySheet("Project Manager"); m_ThreadProperties = new ThreadPropertiesPage; m_PropSheet->AddPage(m_ThreadProperties); m_TestSpec = new TestSpecificationPage; m_PropSheet->AddPage(m_TestSpec); m_MapProts = new MapPrototypes; m_PropSheet->AddPage(m_MapProts); m_PersistPage = new PersistPage; m_PropSheet->AddPage(m_PersistPage); m_ProjViewPage = new ProjectViewPage; m_PropSheet->AddPage(m_ProjViewPage); m_ProjViewPage->SetPMDlg(this); m_PropSheet->Create(this,WS_CHILD,NULL); m_PropSheet->SetWindowPos(NULL,10,27, 750,300,NULL); m_PropSheet->ShowWindow(TRUE); Nothin' much there. Thanks much for your help.

        B Offline
        B Offline
        BadJerry
        wrote on last edited by
        #3

        I hope you found the solution ... if you have not: check this http://support.microsoft.com/default.aspx?scid=kb;en-us;149501[^]

        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