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. Stuck in ShowWindow

Stuck in ShowWindow

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
7 Posts 3 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.
  • D Offline
    D Offline
    dj4400
    wrote on last edited by
    #1

    Hi all, I have a multithreaded application written in c++ vs6. I try to create a new dialog within an existing dialog in that application and when i call ShowWindow(SW_SHOW)for the new dialog it doesnt do anything. If i put a break point there, it seems that it stops in the call to ShowWindow and doesnt continue the execution. Can someone explain this strange behavior and suggest a way to overcome this problem? Thanks Simon.

    M 1 Reply Last reply
    0
    • D dj4400

      Hi all, I have a multithreaded application written in c++ vs6. I try to create a new dialog within an existing dialog in that application and when i call ShowWindow(SW_SHOW)for the new dialog it doesnt do anything. If i put a break point there, it seems that it stops in the call to ShowWindow and doesnt continue the execution. Can someone explain this strange behavior and suggest a way to overcome this problem? Thanks Simon.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      All these dialogs are created on the same thread?

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      L D 2 Replies Last reply
      0
      • M Mark Salsbery

        All these dialogs are created on the same thread?

        Mark Salsbery Microsoft MVP - Visual C++ :java:

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

        Mark Salsbery wrote:

        All these dialogs are created on the same thread?

        ddd_shocron wrote:

        I try to create a new dialog within an existing dialog

        Doesn't that tell you exactly what is being done? It's created within  :laugh:

        led mike

        M 1 Reply Last reply
        0
        • L led mike

          Mark Salsbery wrote:

          All these dialogs are created on the same thread?

          ddd_shocron wrote:

          I try to create a new dialog within an existing dialog

          Doesn't that tell you exactly what is being done? It's created within  :laugh:

          led mike

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          led mike wrote:

          Doesn't that tell you exactly what is being done?

          :sigh: I know it should, but I'm not so bright... ;P (early) Happy New Year! :beer:

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          • M Mark Salsbery

            All these dialogs are created on the same thread?

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            D Offline
            D Offline
            dj4400
            wrote on last edited by
            #5

            yes all these dialogs are created in the same thread. To be more precise i call the create function for that dialog in the ctor of the containing dialog and i call the ShowWindow(SW_SHOW) from within the OnInitDialog ,just before i return true for the OnInitDialog. :sigh: dj4400 formerly known as ddd_shocron

            modified on Thursday, January 1, 2009 3:14 AM

            M 1 Reply Last reply
            0
            • D dj4400

              yes all these dialogs are created in the same thread. To be more precise i call the create function for that dialog in the ctor of the containing dialog and i call the ShowWindow(SW_SHOW) from within the OnInitDialog ,just before i return true for the OnInitDialog. :sigh: dj4400 formerly known as ddd_shocron

              modified on Thursday, January 1, 2009 3:14 AM

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              dj4400 wrote:

              i call the create function for that dialog in the ctor of the containing dialog

              If the containing dialog is used as the parent for the created dialog, then that may not work - the parent dialog window (HWND) hasn't been created yet at that point. Try calling create for the child dialog in the parent's OnInitDialog() (after calling the base class' OnInitDialog()). Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              D 1 Reply Last reply
              0
              • M Mark Salsbery

                dj4400 wrote:

                i call the create function for that dialog in the ctor of the containing dialog

                If the containing dialog is used as the parent for the created dialog, then that may not work - the parent dialog window (HWND) hasn't been created yet at that point. Try calling create for the child dialog in the parent's OnInitDialog() (after calling the base class' OnInitDialog()). Mark

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                D Offline
                D Offline
                dj4400
                wrote on last edited by
                #7

                Thanks Mark, you are right - i called the create function in the OnInitDialog and then it worked properly. :)

                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