|
-
April 21st, 2009, 02:45 AM
#1
[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.
-
April 21st, 2009, 03:58 AM
#2
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.
-
April 21st, 2009, 04:11 AM
#3
Re: Accelerators and the "warning: not executing disabled command" message
 Originally Posted by ovidiucucu
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).
-
April 21st, 2009, 07:41 AM
#4
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.
-
April 21st, 2009, 08:17 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|