Re: OnCommand

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I would avoid any use of OnCommand unless ;you are doing something REALLY exotic which
this is not.

You are confusing the OnCommand handler with the ON_COMMAND message map entry, and they
are largely unrelated, except for some incidental letters.

Note that using ON_COMMAND is not really the best way to recognize the OK button; you
should override the virtual method OnOK and handle it there.

Note that none of what you wrote can possibly make sense, because having declared the
variable Dlg, you cannot invoke any methods on it as you have written. They are not
defined to work if the dialog is not active.
joe

On Fri, 2 Feb 2007 23:41:00 -0800, Al <Al@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I have read how the OnCommand method can be used to test for a Ok button
being pressed. How exactly am I to write this code? I have tried;
CProperty*** Dlg;
Dlg.OnCommand(BN_CLICKED, IDOK) didn't work
Dlg.OnCommand(BN_CLICKED & IDOK, MyOk) didn't work
as you can probably see I am really lost. Please need some help.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.


Quantcast