I am not quite sure what you want but here are a few attempts at solving your problem.

1. Just call your OnOK() fuction if that is where you want the code to go else
2. if you need all the CButton member functions then just add a variable to you button.

If this is not what you want then please try and explain again so I know exactly what you need to do.