J
Jim H
I sometimes get the following error from my Form's Dispose Method when the
application is closing:
-------------------------------------------------
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.windows.forms.dll
Additional information: Cannot call Dispose() while doing CreateHandle().
-------------------------------------------------
How do I find out what is calling CreateHandle()?
Here is the Dispose from the form:
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
m_Logger.StopLogging();
m_Logger.CloseConnection();
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
I have a serial connection in m_Logger, but I close the connection and that
calls CloseHandle(). I don't call CreateHandle at all. I do call
CreateFile if I'm opening a serial connection, but not from Close(). When I
close the app I am not in the process of opening a connection.
Thanks,
jim
application is closing:
-------------------------------------------------
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.windows.forms.dll
Additional information: Cannot call Dispose() while doing CreateHandle().
-------------------------------------------------
How do I find out what is calling CreateHandle()?
Here is the Dispose from the form:
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
m_Logger.StopLogging();
m_Logger.CloseConnection();
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
I have a serial connection in m_Logger, but I close the connection and that
calls CloseHandle(). I don't call CreateHandle at all. I do call
CreateFile if I'm opening a serial connection, but not from Close(). When I
close the app I am not in the process of opening a connection.
Thanks,
jim