20/06/11 23:21
Sparvier0
Salve,
sono alle prese con il seguente errore:
An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.
e si verifica in questo punto del codice:
[CODE]
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
try
{
Form1.deviceAI.Dispose();
Form1.deviceDIO.Dispose();
TimerGiriMotore.Dispose();
TimerPressione.Dispose();
StartTh.Abort();
}
catch
{
}
finally
{
Application.Exit();
}
}
[/CODE]
In particolare qui:
Form1.deviceAI.Dispose();
Form1.deviceDIO.Dispose();
L'errore non si verifica sempre.
Saèreste aiutarmi? Grazie.
sono alle prese con il seguente errore:
An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss.
e si verifica in questo punto del codice:
[CODE]
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
try
{
Form1.deviceAI.Dispose();
Form1.deviceDIO.Dispose();
TimerGiriMotore.Dispose();
TimerPressione.Dispose();
StartTh.Abort();
}
catch
{
}
finally
{
Application.Exit();
}
}
[/CODE]
In particolare qui:
Form1.deviceAI.Dispose();
Form1.deviceDIO.Dispose();
L'errore non si verifica sempre.
Saèreste aiutarmi? Grazie.
Ultima modifica effettuata da Sparvier0 20/06/11 23:21
aaa