Search code examples
c#compact-frameworkwindows-ce

Random get_Font() Exception in my Windows CE(Compact framework ) C# application


I got randomly System.Windows.Forms.Control.get_Font()exception in my C# application when i press any button. My application for Windows CE device which support .net 3.5 compact framework(windows 6 OS)

I have used third party(BeeMobile Toolkit) for custom control

Exception is like below

at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
   at System.Windows.Forms.Control.get_Font()
   at BeeMobile.TransparentControls.TButtonBase.get_Font()
   at BeeMobile.TransparentControls.TButtonBase.DrawText(Graphics gr)
   at BeeMobile.TransparentControls.TVistaButton.RenderButtonBitmap(Bitmap& renderBitmap, InkColor buttonBackground, Color borderColor)
   at BeeMobile.TransparentControls.TVistaButton.get_CurrentImage()
   at BeeMobile.TransparentControls.TButtonBase.Draw(Graphics gxBack)
   at BeeMobile.Common.DoubleBufferingControl.#=qAKWNr500l_h4qDhHRih7lg==()
   at BeeMobile.Common.DoubleBufferingControl.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
   at Microsoft.AGL.Forms.WL.Update(IntPtr hwnThis)
   at System.Windows.Forms.Control.Update()
   at System.Windows.Forms.Control.Refresh()
   at BeeMobile.TransparentControls.TButtonBase.Refresh(Boolean aClearBackBuffer)
   at BeeMobile.TransparentControls.TVistaButton.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)
   at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
   at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
   at System.Windows.Forms.Application.Run(Form fm)
   at BB2000.Program.Main()

Anyone have experienced the same issue? Please help me to resolve this issue

Below is code and snap for more informationenter image description here


Solution

  • I got Exact issue and related comment. This is Windows CE 6.0 OS issue for resolution we need to upgrade OS from Windows CE 6.0 to Windows CE 7.0

    For more detail Please refere Microsoft Below Link

    Windows Embedded Compact 7

    FIX: Font setting changes in a .NET Compact Framework 3.5 app on a Windows Embedded Compact 7-based device