.NET

Reply
*Mike Tuersley
Message 1 of 7 (73 Views)

Fatal error with ToolPalettes

73 Views, 6 Replies
06-01-2005 06:59 AM
I'm using VB.NET, VS2003 and Acad2006 and using mostly COM InterOp due to
the timeline with this project [had to be done "yesterday" . The project
is based on the TabbedDialog example where I have multiple palletes in one
toolpalette set. Each toolpalette is a user control which contains buttons,
textboxes, and labels.

I keep getting an error saying there is an erorr with acmgd.dll, "menu
extension not registered". It occurs after my program is done executing and
I am trying to re-enable a couple buttons that I had disabled.
Unfortunately, this isn't a project I can upload because of the database
pieces, however I have attached the main entry point which creates the
toolpaletteset.

I've tried the workarounds related to other toolpalette issues posted
already, and none of these help. Any ideas or places to look?

TIA

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Albert Szilvasy
Message 2 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-01-2005 07:31 PM in reply to: *Mike Tuersley
The problem is that you don't hold on to your "cme" variable (it is in
function scope). You need to hold on to this as static or member data
somewhere and you have to pass it to RemoveDefaultContextMenuExtension
sometime later when you no longer need the menu extension.

Right now you menu extension is garbage collected and the finalizer
(destructor) of the menu extension says: "hey, you forgot unregister me".

Albert
"Mike Tuersley" wrote in message
news:4861733@discussion.autodesk.com...
I'm using VB.NET, VS2003 and Acad2006 and using mostly COM InterOp due to
the timeline with this project [had to be done "yesterday" . The project
is based on the TabbedDialog example where I have multiple palletes in one
toolpalette set. Each toolpalette is a user control which contains buttons,
textboxes, and labels.

I keep getting an error saying there is an erorr with acmgd.dll, "menu
extension not registered". It occurs after my program is done executing and
I am trying to re-enable a cou
ple buttons that I had disabled.
Unfortunately, this isn't a project I can upload because of the database
pieces, however I have attached the main entry point which creates the
toolpaletteset.

I've tried the workarounds related to other toolpalette issues posted
already, and none of these help. Any ideas or places to look?

TIA

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 3 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-01-2005 10:10 PM in reply to: *Mike Tuersley
Thanks Albert, that makes sense!
*Mike Tuersley
Message 4 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-06-2005 07:29 AM in reply to: *Mike Tuersley
Do you have an example, Albert? I tried it and the problem continues. At
first it sounded logical, but why would the garbae collector only grab it
on the second call and not the first?

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Albert Szilvasy
Message 5 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-06-2005 10:50 AM in reply to: *Mike Tuersley
The EventsWatcher sample on the sdk shows how to use default context menus.

Albert
"Mike Tuersley" wrote in message
news:4866230@discussion.autodesk.com...
Do you have an example, Albert? I tried it and the problem continues. At
first it sounded logical, but why would the garbae collector only grab it
on the second call and not the first?

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 6 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-10-2005 11:50 AM in reply to: *Mike Tuersley
Hey Albert!

Not sure if you're still watching this thread or not. But I've found the
problem after making sure that my "cme" was static.

The problem is the one palette has a button that draws some geometry and
then displays a form. The form contains a couple textboxes and a button
that allows the user to adjust some values prior to completing the drawing
task. The form will display once then the crash occurs with the fatal error
message. I've tried combinations of Show/ShowDialog and Hide/Close/Dispose
but the error persists in different variations - using Hide/Close pops an
error saying the form must be set to Invisible or Closed first before
displaying [which it is and I have tried] while using Dispose is generates
the fatal error. Do you have any ideas for this scenario?

Thanks,

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 7 of 7 (73 Views)

Re: Fatal error with ToolPalettes

06-10-2005 05:48 PM in reply to: *Mike Tuersley
Never mind! I just got off the phone with ADN and the problem is the line:

System.Windows.Forms.Application.EnableVisualStyles()

AutoCAD doesn't like it!

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
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.