.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD 2008 has problems with .NET

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
markus.fritschi
746 Views, 4 Replies

AutoCAD 2008 has problems with .NET

I need some Help from AutoCAD:

I just downloaded the trial version AutoCAD 2008 to test our .NET application with this new version.
It was not possible to make it running!!
The new acmgd.dll seems not to work correctly.

To find out where the error came from I loaded the old DLL's 'acdbmgd.dll' and 'acmgd.dll' from AutoCAD 2006 and everything worked correctly!
The only annoying thing is the message in the AutoCAD commandline: 'acmgd.dll' is incompatible with this version of AutoCAD.

To reproduce the error make the following:

Take Lab7 Demo Code from AutoCAD 2007 .NET Training.3

Private Sub AddContextMenu()
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Try

m_ContextMenu = New ContextMenuExtension()
m_ContextMenu.Title = "Acme Employee Menu"

Dim mi As MenuItem
mi = New MenuItem("Create Employee")
AddHandler mi.Click, AddressOf CallbackOnClick
m_ContextMenu.MenuItems.Add(mi)

Application.AddDefaultContextMenuExtension(m_ContextMenu)
Catch ex As System.Exception
ed.WriteMessage("Error Adding Context Menu: " + ex.Message)
End Try
End Sub

You will be confronted with the following errors:

1) "Cannot find the method on the object instance." ( debug information )
2) Operation is not valid due to the current state of the object.
3) Error Message of Lab7 Class: Error Adding Context Menu: Operation is not valid due to the current state of
the object.

Questions:

a) Does anybody know if there are new dll's from AutoCAD?
b) Why does anybody know about these errors? ( perhaps i am the only person who works with these dll's )
c) are workarounds available?
4 REPLIES 4
Message 2 of 5
Sinc
in reply to: markus.fritschi

I have noticed no such issues with those DLLs.

Did you change both the acmgd.dll and acdbmdg.dll to load the Autocad 2008 version, and did you set "Copy Local" to FALSE for both of them?

And also, you are trying to compile the COMPLETE Lab 7 code, right? If you are only trying to compile the little snippet shown in your post, then it's no wonder it's not working for you. That little snippet is designed to work with other elements in the code, and if you are missing everything else, then you would expect to see errors.
Sinc
Message 3 of 5

This simple "Copy Local" was set to TRUE.
Setting it to FALSE made me very happy. Everything works fine!
Does this mean that our DLL works for both AutoCAD 2008 and AutoCAD 2006, because the DLL's are referenced by AutoCAD?
In other words:
when working with AutoCAD 2006, the dll's are taken from 'C:\Program Files\AutoCAD 2006\*mgd.dll' locations, working with AutoCAD 2008, dll's are taken from 'C:\Program Files\AutoCAD 2008\*mgd.dll' locations?

Thanks to sinc and a merry christmas
Message 4 of 5
Anonymous
in reply to: markus.fritschi

You can find out if the same assembly will work on both releases by loading and testing it. If there are errors, then try making a separate build for 2008 which references its libraries.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5807568@discussion.autodesk.com...
This simple "Copy Local" was set to TRUE.
Setting it to FALSE made me very happy. Everything works fine!
Does this mean that our DLL works for both AutoCAD 2008 and AutoCAD 2006, because the DLL's are referenced by AutoCAD?
In other words:
when working with AutoCAD 2006, the dll's are taken from 'C:\Program Files\AutoCAD 2006\*mgd.dll' locations, working with AutoCAD 2008, dll's are taken from 'C:\Program Files\AutoCAD 2008\*mgd.dll' locations?

Thanks to sinc and a merry christmas
Message 5 of 5
Daniel.Du
in reply to: Anonymous

Keep in mind, For autoCAD plugin development,  always set "Copy local" tp "False".



Daniel Du
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost