Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

FindCommand and GlobalInvoke

$
0
0

why is FindCommand returning null, while GlobalInvoke works?? (the command I'd like to find is none of my commands but from another extension or Visual Studio itself... it works, when I try to find one of my commands... but that's non documented behaviour)

In my callback handler for a menu command, I have this:

var s = package.GetServiceAsync((typeof(IMenuCommandService)));
s.Wait();
OleMenuCommandService commandService = s.Result as OleMenuCommandService;
CommandID c = new CommandID(Guid.Parse("<a guid>"), 234);

MenuCommand mc = commandService.FindCommand(c);
// mc.Invoke(); -> cannot do that, because it's null

commandService.GlobalInvoke(c); // works



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>