Command routing question

Hi,

I'm writing a package and I'd like to intercept some commands that are executed from menus created by another package.  I understand from some VS architecture discussion that commands are normally routed to the package that defines the command and that not every command is routed to every package.  It's stated that it is possible to override this behaviour with a priority command target so that my package can override other packages.  I don't want to change the behaviour of the other package; I just wanted to be notified when a command is executed and add my own custom behaviour (along with do what the owner package does).

Is a priority command target the way to go   How would I go about doing this

Thanks,
Notre


Answer this question

Command routing question

  • Jupp

    Hi Dylan,

    Thanks for your reply.  Rather than implement it as high priority command target, I had my package hook into the DTE CommandEvents.  This seems to work well and gets away from using a priority command target, which I understand is generally not recommended.

    Notre

  • SuganDave

    Notre,

    Have you tried this   Implement your command target at a higher priority, and then after you handle the command, either return S_FALSE, or a real failure code (like E_FAIL) to specifiy your command target didn't handle the command completely.  Try returning S_FALSE first to see if that helps, and if not return a real failure code.

    Please let us know if that doesn't work for you.

    Thanks,

    Dylan

  • Command routing question