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. ATL / WTL / STL
  4. Cannot get CDialogResize to work

Cannot get CDialogResize to work

Scheduled Pinned Locked Moved ATL / WTL / STL
c++visual-studiocom
10 Posts 4 Posters 61 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
    Defenestration
    wrote on last edited by
    #1

    I'm new to WTL and am using WTL 8.0 with VS 2005. I have created a new modeless dialog based app with AppWizard and then made the relevant modifications to get it to resize, according to Michael Dunn's CP article "Using WTL's Built-in Dialog Resizing Class" http://www.codeproject.com/wtl/wtldlgresize.asp It builds OK, and my dialog gets the gripper size box in the bottom right hand corner, but when I grab it the dialog does not resize. Only the grabber size box itself moves. I've tried comparing to other projects which work, but cannot identify any differences.

    D M 3 Replies Last reply
    0
    • D Defenestration

      I'm new to WTL and am using WTL 8.0 with VS 2005. I have created a new modeless dialog based app with AppWizard and then made the relevant modifications to get it to resize, according to Michael Dunn's CP article "Using WTL's Built-in Dialog Resizing Class" http://www.codeproject.com/wtl/wtldlgresize.asp It builds OK, and my dialog gets the gripper size box in the bottom right hand corner, but when I grab it the dialog does not resize. Only the grabber size box itself moves. I've tried comparing to other projects which work, but cannot identify any differences.

      D Offline
      D Offline
      Defenestration
      wrote on last edited by
      #2

      I've uploaded a sample VC++ 2005 project demonstrating my problem. Any help on what's wrong would be greatly appreciated. http://www.freefileupload.net/file.php?file=files/030506/1146617037/Test_CDialogResize_Modeless.zip -- modified at 20:52 Tuesday 2nd May, 2006

      1 Reply Last reply
      0
      • D Defenestration

        I'm new to WTL and am using WTL 8.0 with VS 2005. I have created a new modeless dialog based app with AppWizard and then made the relevant modifications to get it to resize, according to Michael Dunn's CP article "Using WTL's Built-in Dialog Resizing Class" http://www.codeproject.com/wtl/wtldlgresize.asp It builds OK, and my dialog gets the gripper size box in the bottom right hand corner, but when I grab it the dialog does not resize. Only the grabber size box itself moves. I've tried comparing to other projects which work, but cannot identify any differences.

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You forgot the CHAIN_MSG_MAP(CDialogResize<CMainDlg> ) macro in your window's message map

        --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

        D 1 Reply Last reply
        0
        • M Michael Dunn

          You forgot the CHAIN_MSG_MAP(CDialogResize<CMainDlg> ) macro in your window's message map

          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

          D Offline
          D Offline
          Defenestration
          wrote on last edited by
          #4

          Hi Mike, Thanks for taking the time to reply. I've already got that macro in "class CMainDlg" in MainDlg.h. Does it need to be defined elsewhere ? Have you managed to successfully compile and run the sample project I uploaded without any changes ? BEGIN_MSG_MAP(CMainDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) COMMAND_ID_HANDLER(IDOK, OnOK) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) CHAIN_MSG_MAP(CDialogResize<CMainDlg> ) END_MSG_MAP() -- modified at 21:53 Tuesday 2nd May, 2006

          J 1 Reply Last reply
          0
          • D Defenestration

            Hi Mike, Thanks for taking the time to reply. I've already got that macro in "class CMainDlg" in MainDlg.h. Does it need to be defined elsewhere ? Have you managed to successfully compile and run the sample project I uploaded without any changes ? BEGIN_MSG_MAP(CMainDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) COMMAND_ID_HANDLER(IDOK, OnOK) COMMAND_ID_HANDLER(IDCANCEL, OnCancel) CHAIN_MSG_MAP(CDialogResize<CMainDlg> ) END_MSG_MAP() -- modified at 21:53 Tuesday 2nd May, 2006

            J Offline
            J Offline
            Justin Tay
            wrote on last edited by
            #5

            Go to resource view and change the border of IDD_MAINDLG to Resizing.

            D C 3 Replies Last reply
            0
            • D Defenestration

              I'm new to WTL and am using WTL 8.0 with VS 2005. I have created a new modeless dialog based app with AppWizard and then made the relevant modifications to get it to resize, according to Michael Dunn's CP article "Using WTL's Built-in Dialog Resizing Class" http://www.codeproject.com/wtl/wtldlgresize.asp It builds OK, and my dialog gets the gripper size box in the bottom right hand corner, but when I grab it the dialog does not resize. Only the grabber size box itself moves. I've tried comparing to other projects which work, but cannot identify any differences.

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              After investigating, I see that there was a breaking change from WTL 7.0 to 7.1. The third param to CDialogResize::DlgResize_Init() is styles to add to the window. This changed from WS_THICKFRAME|WS_CLIPCHILDREN to just WS_CLIPCHILDREN. As the other post said, the best way is to set the dialog's border to Resizing in the resource editor. (Not doing that, even in WTL 7.0, creates a positioning glitch in XP with themes turned on.)

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

              D 1 Reply Last reply
              0
              • J Justin Tay

                Go to resource view and change the border of IDD_MAINDLG to Resizing.

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

                Thanks hfry! It's working now. You've saved me from insanity! :)

                1 Reply Last reply
                0
                • M Michael Dunn

                  After investigating, I see that there was a breaking change from WTL 7.0 to 7.1. The third param to CDialogResize::DlgResize_Init() is styles to add to the window. This changed from WS_THICKFRAME|WS_CLIPCHILDREN to just WS_CLIPCHILDREN. As the other post said, the best way is to set the dialog's border to Resizing in the resource editor. (Not doing that, even in WTL 7.0, creates a positioning glitch in XP with themes turned on.)

                  --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                  D Offline
                  D Offline
                  Defenestration
                  wrote on last edited by
                  #8

                  Thanks for taking the time to look into it Mike, and for providing an explanation of why it wasn't working. I have now done what hfry suggested and all is working fine now :) It's not important for me now, but I'm sure anyone else who delves into CDialogResize would appreciate it if you updated both your WTL articles which mention CDialogResize to include this snippet of info. 1) Resizing Dialogs section of WTL for MFC Programmers, Part V - Advanced Dialog UI Classes 2) Using WTL's Built-in Dialog Resizing Class Thanks again for your help. I can now continue development of my world beating, super efficient resizable About dialog :-D

                  1 Reply Last reply
                  0
                  • J Justin Tay

                    Go to resource view and change the border of IDD_MAINDLG to Resizing.

                    C Offline
                    C Offline
                    craig broadbear
                    wrote on last edited by
                    #9

                    Thank you! I have tried several times over the last 15 years to get this to work and today I know why!

                    1 Reply Last reply
                    0
                    • J Justin Tay

                      Go to resource view and change the border of IDD_MAINDLG to Resizing.

                      C Offline
                      C Offline
                      craig broadbear
                      wrote on last edited by
                      #10

                      Thank you! I have tried several times over the last 15 years to get this to work and today I know why!

                      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