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

RibbonTab from code crashes Publish command

3 REPLIES 3
Reply
Message 1 of 4
ivo.zagar
486 Views, 3 Replies

RibbonTab from code crashes Publish command

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.

Tags (2)
3 REPLIES 3
Message 2 of 4
fenton.webb
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
AutoCAD Engineering
Autodesk

Message 3 of 4
BlackBox_
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



"How we think determines what we do, and what we do determines what we get."

Message 4 of 4

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

 

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