AnsweredAssumed Answered

ICommandManager.AddCommandTab fails

Question asked by Ron Bates on Jun 10, 2015
Latest reply on Mar 15, 2016 by Nick Sinno

For odd reasons, my add-in gets into a scenario where AddCommandTab fails to return my add-in command tab.

 

ie following typical add-in samples in C#, I have the following code:

 

//if cmdTab is null, must be first load (possibly after reset), add the commands to the tabs

if (cmdTab == null)

{

     cmdTab = _commandMgr.AddCommandTab(type, Title);

 

If _commandMgr is good (i think...how can i tell?) and type is just an swDocumentType_e, then WHY would this call ever fail?

 

It occurs for me when I've done some messing around with standard cmdTab visibility (essentially hidden all cmdTab's but my add-in tab) and then I have some improper shutdown (like a crash).  Under a normal shutdown, I have code that manages the cmdTab visibility and keeps standard UI kosher.  But in the case of a crash, I seem to be stuck.  My add-in fails to load b/c cmdTab is null after above call.

Outcomes