.NET

Reply
Member
Hikeeba!
Posts: 5
Registered: ‎03-19-2006
Message 1 of 5 (157 Views)

Unload Crash

157 Views, 4 Replies
03-20-2006 06:55 AM
I am developing a simple .NET plugin and every time I exit AutoCAD it crashes. This only happens when my plugin is loaded.

I believe I need to do some cleanup during exit but I'm not sure what. The only things I am accessing are AcadApplication, AcadDocument, and XRef blocks. I have about 4 commands defined as well.

Thanks.
Distinguished Contributor
cgay
Posts: 125
Registered: ‎08-02-2005
Message 2 of 5 (157 Views)

Re: Unload Crash

03-20-2006 07:18 AM in reply to: Hikeeba!
It will be difficult to help if we cannot see some source code.

C
Member
Hikeeba!
Posts: 5
Registered: ‎03-19-2006
Message 3 of 5 (157 Views)

Re: Unload Crash

03-20-2006 10:11 AM in reply to: Hikeeba!
OK. Here is my code for creating a menu. Even if I execute none of the commands it crashes on exit.

AcadApplication autocad = Helpers.GetACAD();
foreach(AcadMenuGroup grp in autocad.MenuGroups)
{
if(grp.Name == "ACAD")
{
AcadPopupMenu menu = grp.Menus.Add("&TRIM");
menu.AddMenuItem(0, "&Store", "_STOREIT ");
menu.AddMenuItem(1, "&Retrieve", "_RETRIEVE ");
grp.Menus.InsertMenuInMenuBar("&TRIM", 10);
}
}
Distinguished Contributor
cgay
Posts: 125
Registered: ‎08-02-2005
Message 4 of 5 (157 Views)

Re: Unload Crash

03-21-2006 11:14 AM in reply to: Hikeeba!
What version of AutoCAD are you using?
What version of Visual Studio are you using?
What versions of the .NET framework are loaded on your machine?
Is there an error associated with the crash?
If so, what is the error?
Have you checked the EventViewer for an error message?
Have you checked the output window in Visual Studio to see if there is some indication as to the error?
What does Helpers.GetACAD function actually do?
Do you have all appropriate references added?
Are you implementing the IExtensionApplication interface?
What is you debugging configuration?
How is the dll loaded into AutoCAD?(Netload,Script,Registry,LISP,Another Plugin)?


It would be easier to help if we could duplicate this problem, but I just don't have enough info.
You best bet for help is to ZIP up your project and post it here. At least we would be able to point you in the right direction.

C
Member
Hikeeba!
Posts: 5
Registered: ‎03-19-2006
Message 5 of 5 (157 Views)

Re: Unload Crash

03-21-2006 01:21 PM in reply to: Hikeeba!
I will try to post the code soon, but I can anwswer your questions.

AutoCAD 2005

Visual Studio.NET 2003

Event Viewer error: Faulting application acad.exe, version 22.1.63.0, faulting module mscorwks.dll, version 1.1.4322.2032, fault address 0x00071bd8.

The same error appears in a dialog box when AutoCAD exits.

The GetACAD function just returns (AcadApplication)Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;

I am implementing the IExtensionApplication interface. My custom commands run fine as does loading the DLL.

Are there references tthat I need that don't prevent me from compiling?

I am not doing any debugging as I've had trouble getting VS to connect to the process.

I am loading the DLL with "netload" from within AutoCAD.

Thanks.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.