CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2001
    Location
    Czech Republic
    Posts
    78

    [RESOLVED] Accelerators and the "warning: not executing disabled command" message

    Hi, I have a menu command to which an accelerator is hooked. Whenever the command is disabled (using the ON_UPDATE_COMMAND_UI message) and I press the accelerator key, I get a trace message saying: "Warning: not executing disabled command". It comes from the CWnd::OnCommand method. The command is (correctly) not run, though.

    I am just wondering if it is a normal behaviour that this message appears. Or did I forget something? I previously thought WM_COMMAND messages are not sent even from accelerators when the given command is disabled. This does not seem to me as an elegant solution - to send a message first and only then check if we really should process it.

  2. #2
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Accelerators and the "warning: not executing disabled command" message

    Just a warning message put by the framework which you can easily ignore.
    BTW, I cannot reproduce it under VS2005.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  3. #3
    Join Date
    Mar 2001
    Location
    Czech Republic
    Posts
    78

    Re: Accelerators and the "warning: not executing disabled command" message

    Quote Originally Posted by ovidiucucu View Post
    Just a warning message put by the framework which you can easily ignore.
    BTW, I cannot reproduce it under VS2005.
    Strange, I also use VS2005. The trace message is in wincore.cpp at line 2269 (though I am not sure we both have the same version).

  4. #4
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: Accelerators and the "warning: not executing disabled command" message

    Indeed, there is such message in CWnd::OnCommand and I think not quite for nothing.
    However still I could not reproduce it. Maybe you have overridden OnCmdMsg or other virtual function involved in command routing or have handled WM_INITMENUPOPUP, or...
    Since its quite difficult to follow/reproduce and anyhow, as you have told before, the command handler is not called, my opinion is that you can ignore that warning.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  5. #5
    Join Date
    Mar 2001
    Location
    Czech Republic
    Posts
    78

    Re: Accelerators and the "warning: not executing disabled command" message

    OK, thanks for your time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured