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