2

I have a .NET CF 3.5 application that runs on Motorola WT41N0 (Windows CE 7). Sometimes it gets the following exception:

System.ApplicationException: ApplicationException
   at System.Threading.EventWaitHandle..ctor(Boolean initialState, EventResetMode mode)
   at System.Threading.ManualResetEvent..ctor(Boolean initialState)

The exception occurs at a number of different places. Sometimes it occurs in the Motorola barcode scanner API (Symbol.Barcode2). It also occurs at the following code:

private void Transmitter_StatusChanged(object sender, TransmitStatusChangedEventArgs e)
{
    Invoke(() =>
    {
        UpdateScanStatus();
    });
}

this is the UpdateScanStatus Method:

private void UpdateScanStatus()
{
    int unsent = THSData.Transmitter.PendingScans;
    string unsentText = string.Format("Unsent Scans:{0}", unsent);
    if (lblUnsent.Text != unsentText)
        lblUnsent.Text = unsentText;

    if (HeaderBarWarning != unsent > 0)
    {
        lblUnsent.Visible = unsent > 0;
        UpdateHeaderBar(unsent > 0);
    }
}

here is the full stack trace for this example:

Fatal Error System.ApplicationException: ApplicationException
   at System.Threading.EventWaitHandle..ctor(Boolean initialState, EventResetMode mode)
   at System.Threading.ManualResetEvent..ctor(Boolean initialState)
   at System.Windows.Forms.Control.TASK.get_AsyncWaitHandle()
   at System.Windows.Forms.Control.InvokeHelper(Delegate method, Boolean fSynchronous, Object[] rgobjArgs)
   at CoreTT.Scanner.THS.UI.Pages.PageLogin.Transmitter_StatusChanged(Object sender, TransmitStatusChangedEventArgs e)
   at CoreTT.Scanner.Common.DataAccess.BaseTransmitter.InvokeStatusChange(String oldStatus, String newStatus, Object statusObject)
   at CoreTT.Scanner.Common.DataAccess.BaseTransmitter.set_Status(String value)
   at CoreTT.Scanner.Common.DataAccess.BaseTransmitter.Transmit()
   at CoreTT.Scanner.Common.DataAccess.BaseTransmitter.timer_TimerCallback(Object state)
   at System.Threading.Timer.ring()

Does anyone know what could be causing the error.

Lief
  • 535
  • 3
  • 5
  • 14

1 Answers1

0

This error seems to happen when the system runs out of memory. There was a memory leak in the software and since this has been fixed the exception does not seem to be occurring anymore.

Lief
  • 535
  • 3
  • 5
  • 14