.NET

.NET

Reply
Active Member
8 Posts
0 Kudos
Registered: ‎03-19-2011
Post 1 of 4

RibbonTab from code crashes Publish command

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

Hi,

 

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
352 Posts
27 Kudos
Registered: ‎07-24-2007
Post 2 of 4

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
787 Posts
80 Kudos
Registered: ‎02-25-2013
Post 3 of 4

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.

 

Cheers



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 4 of 4

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:

 

http://www.theswamp.org/index.php?topic=44440.msg496962#msg496962

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!