Ribbon tab title vanishing...

Hopefully someone can point me in the right direction on this one...

 

I'm just trying to set up a simple SE addin (ST2 MP12 - version 102), which I am coding in Visual C++ 2010. The aim is extremely simple: two buttons that will link to a folder/web page. I have my two buttons displaying ok-ish (they are on their own tab, but are also lingering on the add-ins tab as well). The biggest issue is that the title of their dedicated tab gets wiped when you disconnect from an environment, and doesn't come back until you either restart SE or manually unload/reload the addin in the addin manager.

 

The code compliles with no errors. The code is based on the AsmLoc example supplied with the ST2 SDK, which I have adapted to work with the basic addin template on Code Project (http://www.codeproject.com/Articles/33576/Solid-Edge-ST-Addins-Part-I) and VC++2010.

 

Posted by: Paul Dobson
Post date: 2/27/2012 10:21:19 AM

6 REPLIES

Re: Ribbon tab title vanishing...

Does ST2 have the VC sample add-in under the sdk\samples\addins directory? If so, what happens with that add-in?

 

Give this a try. Disconnect the add-in via the add-in manager and exit. Come up one time and then exit again (trying to flush any toolbar data from the registry). Then go to your add-in code and comment out any code that adds a toolbar (and button). Then come up in edge and load your add-in. See if the problem persists.

 

If all else fails, send me the add-in.

 

Posted by: R.D. Holland
Post date: 2/27/2012 1:27:43 PM

Re: Ribbon tab title vanishing...

OK, I am completely stumped, so if you are still willing to take a look at my code, it would be much appreciated.

 

I went back and got AsmLoc to compile OK with VC++2010, and then stripped out code I didn't need. Still built fine, worked as expected.

 

I then made a new project from that code, all new guids etc, different tab, category and command names, got that building (although not quite as well - for some reason I can't work out pre-compiled headers would not work with this one), and working fine. But only on it's own.

 

It turns out that only one addin created from this code can execute AddCommandBarButton() without throwing a _com_error (incorrect parameter). Even the previous version I tried that had the tab display issues generates this error.

 

I've trawled through the code several times, and cannot work out what's causing this, so I attach both the stripped-down AsmLoc project, and my new project made from that code so you can have a look for yourself.

 

 

I'm having no luck anyway right now - I thought I'd give it a go in C# instead, but can't get that to appear in SE at all in x64.

 

Posted by: Paul Dobson
Post date: 3/22/2012 7:16:40 AM

Re: Ribbon tab title vanishing...

Yeah I knew about that one - I was incrementing that value consistently while I was trying to make it work, to no avail.

 

As I said though, that particular problem is solved by using the AsmLoc code rather than following the CodeProject example. I've just got this weird conflict issue getting in my way now that I can't resolve (because I don't understand what's causing it).

 

Posted by: Paul Dobson
Post date: 3/22/2012 7:31:25 AM

Re: Ribbon tab title vanishing...

In accordance with the Law of Sod, I have of course solved the problem. I managed to overlook changing the unique command tags. Everything works properly now!

 

 

[edit] Now that I've got the UI displaying properly, it gives rise to another question: can 2 or more separate addins place commands on a shared custom tab? Trying it only manages to give me two different tabs with the same name, which isn't exactly what I'm after...

 

Posted by: Paul Dobson
Post date: 3/23/2012 4:47:33 AM

Re: Ribbon tab title vanishing...

The thinking was that addins would be created as and when required, and their commands would all be placed on a common tab named after our organisation. However I'm already thinking that is probably the wrong approach, since it would necessitate loading all the basic connection and event handling code into memory for each seaparate addin, whereas a single addin containing all our required extras would be more memory efficient.

 

I assume the customisation API was introduced in ST3? As far as I'm aware, there is no way to customise the ribbon inside SE at ST2. The only customisation available is adding buttons to the quick access toolbar.

 

Posted by: Paul Dobson
Post date: 3/23/2012 10:05:28 AM

Re: Ribbon tab title vanishing...

I have this working quite nicely now, so thanks for all your help!

 

Posted by: Paul Dobson
Post date: 5/3/2012 8:37:36 AM