Re: CEdit Control Question
Add a public variable attached to the CEdit control.
In the OnOK() or any other function that closes the dialog do an UpdateData().
Now in the main code after the DoModal you can access it like dlg.publicvariable.
Re: CEdit Control Question
Quote:
Originally Posted by
_Superman_
Add a public variable attached to the CEdit control.
In the OnOK() or any other function that closes the dialog do an UpdateData().
Now in the main code after the DoModal you can access it like dlg.publicvariable.
Thanks for the reply. Can you tell me where do I add the public variable CEdit ? I understand what you mean as to where to place the UpdateData(TRUE); Also how does the application know that the CEdit (public) variable is associated with my IDC_EDIT1 ?
Re: CEdit Control Question
Quote:
Originally Posted by
justmehere
Thanks for the reply. Can you tell me where do I add the public variable CEdit ? I understand what you mean as to where to place the UpdateData(TRUE); Also how does the application know that the CEdit (public) variable is associated with my IDC_EDIT1 ?
the application would know if you associate a member variable with your edit. you can either use class wizard to do this, or do it manually. if you decide to use class wizard, open your dialog that contains the edit and double click on the edit while pressing "Ctrl". this will bring up a dialog where you can choose your variable type. you can achieve the same behavior right-clicking the edit and selecting "Add variable..."
Re: CEdit Control Question
Quote:
Originally Posted by
Alin
the application would know if you associate a member variable with your edit. you can either use class wizard to do this, or do it manually. if you decide to use class wizard, open your dialog that contains the edit and double click on the edit while pressing "Ctrl". this will bring up a dialog where you can choose your variable type. you can achieve the same behavior right-clicking the edit and selecting "Add variable..."
Many thanks Alin all is working. Appreciate both replies.