Either send a custom windows message to the hWnd of the second and have a message handler for it in the second, or have the first call a public method of the CDialog derived object of the second.
However, if I recall correctly from a previous question of yours, you are starting the second dialog as a modal dialog from the first.
That means that the first dialog will effectively be suspended while the second is running. It will never get any keystrokes while the second is open. In my (mis)understanding of what you are doing, you are coding for a situation that your design specifically precludes from ever occurring.
ge6a93 later wrote:
My first dialog is modal, but the second one is not.
Good. :)
If, by chance, this is a value that you want to use to initialize your second dialog when you create it, then write the constructor of your second dialog's class to accept it as a parameter.
If your first dialog created the second, it has (or at least had) access to the CDialog derived object instance associated with the second dialog. Then, as long as second dialog still exists, you could use either of the suggestions in my first paragraph to send the value to the second dialog.