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

Fatal error with ToolPalettes

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
229 Views, 6 Replies

Fatal error with ToolPalettes

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...
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

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...
Message 3 of 7
Anonymous
in reply to: Anonymous

Thanks Albert, that makes sense!
Message 4 of 7
Anonymous
in reply to: Anonymous

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...
Message 5 of 7
Anonymous
in reply to: Anonymous

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...
Message 6 of 7
Anonymous
in reply to: Anonymous

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...
Message 7 of 7
Anonymous
in reply to: Anonymous

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...

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