On a WindowsCE platform (custom build) our C# gui uses regular forms to show an "popup menu". We set the FormBorderstyle to None as we don't want the form controls to be visible.
Some clients reported "Gray boxes" after a while. After some testing here we could reproduce the problem quite fast. When we open 2 different menu's (forms) constantly the platform shows us an native exception.
Error
A native exception has occurred in Tiger.CEHost.exe. Select Quit and then restart this program, or select Details for more information.
The details:
Error
ExceptionCode: 0xC0000005
ExceptionAdress: 0x00000001
Reading: 0x00000001at WL.SetSTyle(IntPtr hwnThis, UInt32 dwMask, UInt32 dwStyle)
at Form._SetBorderStyle(AGL_WINDOWSTYLE wstyVal, AGL_WINDOWSTYLE wstyMask)
at Form.set_FormBorderStyle(FormBorderStyle value)
at pDropDown.PopupForm.Show()
at pDropDown.Show()
at pButton.ShowHideDropDown()
at pButton.OnClick(EventArgs e)
at Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
at Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
at EVL.EnterMainLoop(IntPtr hwnMain)
at Application.Run(Form fm)
at Program.Main(String[] args)
It always seems to fail at the FormBorderStyle property. We've already tried to remove all the pInvokes as perhaps some memory was overwritten, but this didn't help.
We also log each call to the Show method and each call is made in the gui thread and the Form contains a valid handle.