Overiding OnOK
-
Just a quick question? Why is the value of the member variable linked to an edit box always empty until I call CDialog:OnOK(). I'm guessing it has something to do with DoDataExchange but I haven't quite worked out what. What is the proper way to do this because I was always under the impression that you should call the base class last...
-
Just a quick question? Why is the value of the member variable linked to an edit box always empty until I call CDialog:OnOK(). I'm guessing it has something to do with DoDataExchange but I haven't quite worked out what. What is the proper way to do this because I was always under the impression that you should call the base class last...
-
Just a quick question? Why is the value of the member variable linked to an edit box always empty until I call CDialog:OnOK(). I'm guessing it has something to do with DoDataExchange but I haven't quite worked out what. What is the proper way to do this because I was always under the impression that you should call the base class last...
Just a quick answer: call UpdateData() and your member variable will be up to date. Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
-
Just a quick question? Why is the value of the member variable linked to an edit box always empty until I call CDialog:OnOK(). I'm guessing it has something to do with DoDataExchange but I haven't quite worked out what. What is the proper way to do this because I was always under the impression that you should call the base class last...
There is no rule about calling base class functionality. If you need it to do its work before your work, you call it first. If you need it to do it after, you call it after. If you don't care either way, then do it one or the other, but always be consistent. OnOK() calls UpdateData() during its processing, which you can do at any time you need to (though some say that having to call UpdateData() is a sign of a poorly designed program. I don't always agree, Dialog based apps often need to call it).