I am using Solid Edge ST4. I find that calling Application.Quit() sometimes crashes the application 'Silently'.
I say 'Silently' here because the application seems to be terminated normally, but an Error Report is written to ...\AppData\Local\Microsoft\Windows\WER.
The Error Report is about 200+MB, depends on the memory usage of Solid Edge. Does anyone know this problem? How to solve it professionally?
All I have done is starting Solid Edge - DoIdle - Quit, and repeated it ten times. 3~7/10 crashed.
Solved! Go to Solution.
You could try to post WM_ClOSE message to Solid Edge to quit.
It works for me.
Dim objApplication As SolidEdgeFramework.Application = Nothing Dim objType As Type = Nothing objType = Type.GetTypeFromProgID("SolidEdge.Application") For i As Integer = 1 To 10 objApplication = Activator.CreateInstance(objType) objApplication.Visible = True objApplication.DoIdle() objApplication.Quit() System.Runtime.InteropServices.Marshal.FinalReleas
Another one replaces
And the last one removes the 'releasing' code:
The first and second both crash Solid Edge. The last one seems to work.
Sorry, I missed an important information: the crash happens when I close my application and quit Solid Edge in FormClosed event.
The following is some example codes:
Dim objApplication As SolidEdgeFramework.Application = Nothing
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim objType As Type = Nothing objType = Type.GetTypeFromProgID("SolidEdge.Application") objApplication = Activator.CreateInstance(objType) objApplication.Visible = True objApplication.DoIdle() End Sub
Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed objApplication.Quit() End Sub
The crash reports are written to C:\Users\[UserName]\AppData\Local\Microsoft\Window
Thank you @jnewell