G
Guest
Ok, here is what I was going to post
"Ok, I have a custom form that behaves like the MSN Messenger popup. I wrote a small demo with two tabs: one tab has a few controls that allows you to modify some properties of the popup window (caption, position, animation, etc...) On the second tab I have a propertyGrid who's SelectedObject is the popup window. When I alter properties from code or from using the controls (popupWindow1.<property> = whatever) it all works ok. However, when I use the property grid to change properties a strange thing happens: when I change a property that is represented by an enum (like BorderStyle), I can change it once, but when I change it the second time a SEHException occurs... Here is the stack trace
StackTrace " at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at MyFormProject.MainForm.Main()
I need at least to know if there is something broken in my form or if this is some sort of weird behavior in connection with the propertyGrid? I don't understand why DispatchMessage would raise an error? It doesn't seem an usual thing from my win32 knowledge...
Here is some more details about the exception
ErrorCode -2147467259 in
_COMPlusExceptionCode -532459699 in
However, while testing this is what I also noticed: If I double click the combo in the property grid which automatically switches the value to the next in the list, no error occurs and the form correctly updates. The error occurs ONLY if I drop down the combo in the property grid and choose another value with the mouse. This makes me think that there is something wrong with either the property grid or the UITypeEditor.
Before posting I decided to do more tests... Guess what: the same thing was happening with ANY control associated with the property grid. And guess what: when I removed the Application.EnableVisualStyles() from the Form_Load, it all went away... So, beware: EnableVisualStyles is a bad thing to use. Probably it might have some other side effects too..
regards
iulia
"Ok, I have a custom form that behaves like the MSN Messenger popup. I wrote a small demo with two tabs: one tab has a few controls that allows you to modify some properties of the popup window (caption, position, animation, etc...) On the second tab I have a propertyGrid who's SelectedObject is the popup window. When I alter properties from code or from using the controls (popupWindow1.<property> = whatever) it all works ok. However, when I use the property grid to change properties a strange thing happens: when I change a property that is represented by an enum (like BorderStyle), I can change it once, but when I change it the second time a SEHException occurs... Here is the stack trace
StackTrace " at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at MyFormProject.MainForm.Main()
I need at least to know if there is something broken in my form or if this is some sort of weird behavior in connection with the propertyGrid? I don't understand why DispatchMessage would raise an error? It doesn't seem an usual thing from my win32 knowledge...
Here is some more details about the exception
ErrorCode -2147467259 in
_COMPlusExceptionCode -532459699 in
However, while testing this is what I also noticed: If I double click the combo in the property grid which automatically switches the value to the next in the list, no error occurs and the form correctly updates. The error occurs ONLY if I drop down the combo in the property grid and choose another value with the mouse. This makes me think that there is something wrong with either the property grid or the UITypeEditor.
Before posting I decided to do more tests... Guess what: the same thing was happening with ANY control associated with the property grid. And guess what: when I removed the Application.EnableVisualStyles() from the Form_Load, it all went away... So, beware: EnableVisualStyles is a bad thing to use. Probably it might have some other side effects too..
regards
iulia