A
Alain Dekker
Hi,
Using VS 2005, C# targetting CF .NET v2.0 on Windows CE.
Really confused with this one. I have a modal dialog which I display on a
form. The dialog asks me to perform certain tasks (its an application in a
factory, the tasks in this case are to pass packs along a conveyor, there is
an electrical signal generated by a photoeye in front of a piece of
equipment, then another signal from another photoeye after the equipment).
The tasks are complete when all packs requested have passed the first
photoeye. Once all tasks are complete, I display a message on the bottom,
"All done!" and then a timer ticks and about 2s later, I close the form.
Fine, works well.
Occasionally, a mistake is made in the task. For example, the pack passes
the first photoeye but then falls off the conveyor. In this case, I pop up
another modal dialog to show an error. If I display this while there are
still tasks to complete (the operator needs to pass 5 packs, and we're on
pack 3), then simply ok the fault message, complete the rest of the tasks,
and everything works fine.
But, if I show this fault dialog after all five packs have passed the first
photoeye, when I display my "All done!" message and close the earlier modal
dialog, I get an exception. Cannot understand why. Exception stack is as
follows:
System.ArgumentException was unhandled
Message="Value does not fall within the expected range."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Form._CloseModal()
at System.Windows.Forms.Form.Close()
at IQ3_GUI.frmMain_PVS.tmrPVTest_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmMain.SetCurrentProductValues()
at IQ3_GUI.frmMain.tmrDisplay_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmMain.RunPVSTest()
at IQ3_GUI.frmMain.btnPVS_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Control.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmCommon.Start_IQ()
at IQ3_GUI.frmCommon.tmrLoad_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at IQ3_GUI.Program.Main()
Any ideas? Thanks in advance,
Alain
Using VS 2005, C# targetting CF .NET v2.0 on Windows CE.
Really confused with this one. I have a modal dialog which I display on a
form. The dialog asks me to perform certain tasks (its an application in a
factory, the tasks in this case are to pass packs along a conveyor, there is
an electrical signal generated by a photoeye in front of a piece of
equipment, then another signal from another photoeye after the equipment).
The tasks are complete when all packs requested have passed the first
photoeye. Once all tasks are complete, I display a message on the bottom,
"All done!" and then a timer ticks and about 2s later, I close the form.
Fine, works well.
Occasionally, a mistake is made in the task. For example, the pack passes
the first photoeye but then falls off the conveyor. In this case, I pop up
another modal dialog to show an error. If I display this while there are
still tasks to complete (the operator needs to pass 5 packs, and we're on
pack 3), then simply ok the fault message, complete the rest of the tasks,
and everything works fine.
But, if I show this fault dialog after all five packs have passed the first
photoeye, when I display my "All done!" message and close the earlier modal
dialog, I get an exception. Cannot understand why. Exception stack is as
follows:
System.ArgumentException was unhandled
Message="Value does not fall within the expected range."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Windows.Forms.Form._CloseModal()
at System.Windows.Forms.Form.Close()
at IQ3_GUI.frmMain_PVS.tmrPVTest_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmMain.SetCurrentProductValues()
at IQ3_GUI.frmMain.tmrDisplay_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmMain.RunPVSTest()
at IQ3_GUI.frmMain.btnPVS_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Control.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterModalDialog()
at System.Windows.Forms.Form.ShowDialog()
at IQ3_GUI.frmCommon.Start_IQ()
at IQ3_GUI.frmCommon.tmrLoad_Tick()
at System.Windows.Forms.Timer._WnProc()
at
System.Windows.Forms.ApplicationThreadContext._InternalContextMessages()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at IQ3_GUI.Program.Main()
Any ideas? Thanks in advance,
Alain