Active Member
Posts: 8
Registered: ‎03-19-2011
Message 1 of 4 (231 Views)

RibbonTab from code crashes Publish command

231 Views, 3 Replies
04-18-2013 08:23 AM



I have a plugin to Exchange store (if the DLL is loaded from ApplicationPlugins folder, ComponentMaćnager.Ribbon does not exist in IExtensionApplication.Initialize() event). This is why I am creating Ribbon from ComponentManager.ItemInitialized event, as described in this postIn the event, I create new Ribbon tab:

            RibbonPanelSource panelSrc = new RibbonPanelSource();
            panelSrc.Name = name;
            panelSrc.Title = title;
            panelSrc.Id = id;


The commands are loaded and everything works fine, but I get error message, when trying to Publish sheet list. Exception information in minidump:

The thread tried to read from or write to a virtual address for which it does not have the appropriate access.


The error does not occur, if I remove the plugin or if I do not create Ribbon from code.



Thanks for any suggestion, cheers.

ADN Support Specialist
Posts: 352
Registered: ‎07-24-2007
Message 2 of 4 (197 Views)

Re: RibbonTab from code crashes Publish command

04-22-2013 04:01 PM in reply to: ivo.zagar

You can't initialize the Ribbon from Initialize. Check out this link http://adndevblog.typepad.com/autocad/2013/04/autoloader-example-for-invoking-a-startup-command-in-a...

Fenton Webb

Developer Technical Services

Autodesk Developer Network

Distinguished Mentor
Posts: 772
Registered: ‎02-25-2013
Message 3 of 4 (194 Views)

Re: RibbonTab from code crashes Publish command

04-22-2013 04:19 PM in reply to: fenton.webb

Fenton, if I may, the OP is not attempting to add the RibbonTab via Initialize(), he's following Augusto's post to use Initialize() to hook ComponentManager.ItemInitialized event.


Besides, methinks that's the least of the OP's issue, given the seemingly related Publish crash.



"Potential has a shelf life." - Margaret Atwood

Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

Valued Mentor
Posts: 370
Registered: ‎05-06-2012
Message 4 of 4 (188 Views)

Re: RibbonTab from code crashes Publish command

04-22-2013 05:28 PM in reply to: ivo.zagar

The ComponentManager's ItemInitialized event is really not an appropriate place to do ribbon initialization, so I'm not sure what the person that wrote that ADN post was thinking, but that's a 'hack' that he obviously hasn't tested.


Can you tell us what BACKGROUNDPLOT is set to?


You can use the class posted in this thread to ensure that your ribbon initialization code runs in the correct execution context:




Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.