RibbonTab from code crashes Publish command

RibbonTab from code crashes Publish command

Anonymous
Not applicable
1,238 Views
3 Replies
Message 1 of 4

RibbonTab from code crashes Publish command

Anonymous
Not applicable

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.

0 Likes
1,239 Views
3 Replies
Replies (3)
Message 2 of 4

fenton_webb
Autodesk
Autodesk

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

0 Likes
Message 3 of 4

BlackBox_
Advisor
Advisor

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

Sincpac C3D

0 Likes
Message 4 of 4

DiningPhilosopher
Collaborator
Collaborator

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

 

0 Likes