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. My dialog doesn't get focus

My dialog doesn't get focus

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
7 Posts 4 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.
  • R Offline
    R Offline
    Robert1974
    wrote on last edited by
    #1

    I have a common C++ program and try to execute DoModal() on my dialog. When I do it from within the view it goes well but when i do it from another dialog that is a child to the view the dialog doesn't get focus even though i click in it. When I click on my program down in the program bar, the dialog gets focus. Anybody had this problem? Robert

    T 1 Reply Last reply
    0
    • R Robert1974

      I have a common C++ program and try to execute DoModal() on my dialog. When I do it from within the view it goes well but when i do it from another dialog that is a child to the view the dialog doesn't get focus even though i click in it. When I click on my program down in the program bar, the dialog gets focus. Anybody had this problem? Robert

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

      yes it does. just take care off the return value of OnInitDialog()


      TOXCCT >>> GEII power

      R 2 Replies Last reply
      0
      • T toxcct

        yes it does. just take care off the return value of OnInitDialog()


        TOXCCT >>> GEII power

        R Offline
        R Offline
        Robert1974
        wrote on last edited by
        #3

        What do you mean by take care of. I can override OnInitDialog and get the value that the base class returns, but what should I do with it.

        T R 2 Replies Last reply
        0
        • R Robert1974

          What do you mean by take care of. I can override OnInitDialog and get the value that the base class returns, but what should I do with it.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          the last OnInitDialog() line is that one :

          return TRUE; // return TRUE unless you set the focus to a control

          what does it make you fell ??


          TOXCCT >>> GEII power

          P 1 Reply Last reply
          0
          • T toxcct

            yes it does. just take care off the return value of OnInitDialog()


            TOXCCT >>> GEII power

            R Offline
            R Offline
            Robert1974
            wrote on last edited by
            #5

            Solved it. the problem was that I posted the message to another window that created the dialog.

            1 Reply Last reply
            0
            • R Robert1974

              What do you mean by take care of. I can override OnInitDialog and get the value that the base class returns, but what should I do with it.

              R Offline
              R Offline
              Robert A T Kaldy
              wrote on last edited by
              #6

              Did you set the pointer to the first dialog as a parent of the second? Robert-Antonio "Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries."

              1 Reply Last reply
              0
              • T toxcct

                the last OnInitDialog() line is that one :

                return TRUE; // return TRUE unless you set the focus to a control

                what does it make you fell ??


                TOXCCT >>> GEII power

                P Offline
                P Offline
                Prakash Nadar
                wrote on last edited by
                #7

                toxcct wrote: what does it make you fell ?? I feel that you must be feeling very stupid with your answer. :-O


                God is Real, unless declared Integer.

                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