Dear all,
I am writing a window form application.
When I terminate the api, there will be an error that cannot be catch with try-catch in C#.
Does anyone know the reasons and how to fix it?
Code:
if (Autodesk.Navisworks.Api.Controls.ApplicationControl.IsInitialized)
Autodesk.Navisworks.Api.Controls.ApplicationControl.Terminate();
Error:
Message:Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack trace:
at Autodesk.Navisworks.Api.Interop.LcOpState.InternalCleanup(Boolean queue)
at Autodesk.Navisworks.Internal.ApiImplementation.Manager.Invalidate()
at Autodesk.Navisworks.Internal.ApiImplementation.ApplicationImpl.TerminateApi()
at Autodesk.Navisworks.Api.Controls.ApplicationControl.TerminateImpl()
at MDIViewer.Program.Main() in D:\......\Program.cs:line 225
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Thanks,
John
Hi Xiaodong,
I am sorry that I cannot trigger that error in SDK or MDI viewer.
I will try to provide a test model, but I am not sure I can produce it.
Thanks,
John
Can't find what you're looking for? Ask the community or share your knowledge.