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. HELP: WM_GETDLGCODE Loop

HELP: WM_GETDLGCODE Loop

Scheduled Pinned Locked Moved C / C++ / MFC
helpcomdockerhardwarequestion
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.
  • Z Offline
    Z Offline
    Zac Howland
    wrote on last edited by
    #1

    I have an ActiveX control that I wrote that is a Simple Frame Control with an Embedded Property Sheet. The sheet has 2 pages with each page having a few controls on it. Here is its basic structure: - Control Class ---- Property Sheet Class -------- Page 1 Class -------- Page 2 Class This control works fine in the ActiveX Test Container as well as when I put it on a dialog by itself. However, if I put an OK button on the dialog with the control, I end up getting into an infinite message loop with the WM_GETDLGCODE message being sent/handled constantly. I have tried playing around with the DS_CONTROL, WS_EX_CONTROLPARENT, WS_TABSTOP, and WS_GROUP flags for the controls, pages, and the sheet itself as well as the test dialog, but it still ends up in this loop anytime the ActiveX control loses focus and then regains it (e.g. if the OK button gains focus, but is not clicked or if another program is made active and then I return to my test container). My test container is very simple: - Dialog class ---- CWnd wrapper for ActiveX control Has anyone had this problem or know of a possible solution to it? If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

    Z 1 Reply Last reply
    0
    • Z Zac Howland

      I have an ActiveX control that I wrote that is a Simple Frame Control with an Embedded Property Sheet. The sheet has 2 pages with each page having a few controls on it. Here is its basic structure: - Control Class ---- Property Sheet Class -------- Page 1 Class -------- Page 2 Class This control works fine in the ActiveX Test Container as well as when I put it on a dialog by itself. However, if I put an OK button on the dialog with the control, I end up getting into an infinite message loop with the WM_GETDLGCODE message being sent/handled constantly. I have tried playing around with the DS_CONTROL, WS_EX_CONTROLPARENT, WS_TABSTOP, and WS_GROUP flags for the controls, pages, and the sheet itself as well as the test dialog, but it still ends up in this loop anytime the ActiveX control loses focus and then regains it (e.g. if the OK button gains focus, but is not clicked or if another program is made active and then I return to my test container). My test container is very simple: - Dialog class ---- CWnd wrapper for ActiveX control Has anyone had this problem or know of a possible solution to it? If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      I found a solution. As it turns out, Windows/MFC (not sure which) sets the default flags (regardless of what you turn on or off in the dialog template). To get around this, I had to use ModifyStyle and ModifyExStyle to remove the DS_CONTROL, WS_TABSTOP, and WS_EX_CONTROLPARENT flags from the property pages. If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

      G 1 Reply Last reply
      0
      • Z Zac Howland

        I found a solution. As it turns out, Windows/MFC (not sure which) sets the default flags (regardless of what you turn on or off in the dialog template). To get around this, I had to use ModifyStyle and ModifyExStyle to remove the DS_CONTROL, WS_TABSTOP, and WS_EX_CONTROLPARENT flags from the property pages. If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

        G Offline
        G Offline
        Gary R Wheeler
        wrote on last edited by
        #3

        Zac Howland wrote: 8 hours a day, 5 days a week Lucky you; you've only got it for 40 hours a week. :-D


        Software Zen: delete this;

        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