I have developed a C# winforms app with RealDWG SDK. When I close my form I get the "App has stopped working" error below.
I've added in some Dispose methods to see if that was the issue, but I still get the error.
I added a dispose method to my HostApplication class and I called my Winform dispose method.
I thought that the error was caused by unfinished RealDWG business at the Form Closing event.
I am using RealDWG 2013, Visual Studio 2010 SP1, Windows 7 64-bit.
I also have AutoCAD 2012 and 2013 installed.
I know that AutoCAD and RealDWG both use acdb19.dll.
My app contains 6 classes with around 1000 lines of code on each class, so to paste in my code would be impossible. Here is my code structure.
I start by implementing a HostApplicationService Class (MyHost.cs)
Then I call my Windows Form. (MainForm.cs)
From my form I collect object data from a SqlDatabase.
Once the data is aquired, I send the data to a Class that handles my AutoCAD classes. (AutoCAD.cs)
In this class I create my RealDWG Database.
Next I pass the database to various IDisposable classes that perform AutoCAD actions.
I.E, CreateTitleBlock() CreateLayers(), DrawShape(); etc..
Everything works great, except when I go to close the app, I get the error.
I dispose everything I can think of right before exiting.
I've tried
this.Close();
Application.Exit();
Any ideas on how to dispose the app or close it cleanly?
Thanks,
Eric
Here is the error....
Problem signature:
Problem Event Name: APPCRASH
Application Name: LongBayRD.exe
Application Version: 1.0.0.0
Application Timestamp: 519fa185
Fault Module Name: acdb19.dll
Fault Module Version: 19.0.55.0
Fault Module Timestamp: 4f309c70
Exception Code: c0000005
Exception Offset: 0000000000058166