If I interpret the question correctly there are two dialogs ServicesDlg and CThirdDlg. On the ServicesDlg dialog there is an Edit control EdtCompanyName and a button BtnNextSecondDlg. If you press the button, the text from EdtCompanyName should be taken over and the ServicesDlg dialog should be closed? After that a new dialog with an edit control EdtCompanyNameEnd should be opened directly and the saved text should be displayed there again?
Here I assumed that both dialogs are modal dialogs, which are displayed with DoModal().
Usually such dialogs are terminated with one of the buttons OK or Cancel. With OK, data is usually accepted by the caller, with Cancel, all input is usually discarded. So the button BtnNextSecondDlg could be the OK button?
An alternative would be that both dialogs are not modal and are displayed simultaneously with the main program. The first dialog would then not have to be closed. The dialogs would then behave like multiple windows. To display data from a control in one window also in another control in another window you could send the text as a message to the control.
A better description of the problem as well as excerpts of the source code would possibly allow better answers. I suspect that ChatGPT would also need more specifics to make suggestions.
I would suggest that you first read how dialogs work, then start the corresponding program. If you have concrete questions or problems you could discuss them here.
Maybe a link to these topics will help:
Working with Dialog Boxes in MFC