Re: Dialog Edit Box Access
Create a control member variable (say, m_myEdit) for the editbox and use it to set the text to this control:
Code:
m_myEdit.SetWindowText(_T("Some text"));
Re: Dialog Edit Box Access
That's the problem, VictorN: writing to an Edit Box, whether it's a CString or a control member, work fine from within the Dialog, i.e in *Dlg.cpp . But the various modules in different cpp files, whilst they can be invoked from the Dlg, cannot access the Edit Box. How can I get a handle on the Dlg from a function which has been triggered from the Dlg, and which is in a separate source file ? The dialog "knows" the executing function, but the function does not know the object which triggered it.
Re: Dialog Edit Box Access
You can pass a pointer to the dialog object to those functions. Or you can pass the handle to the window you want to update and from those functions send appropriate messages to the window.
Re: Dialog Edit Box Access
Sounds cool Cilu.
But from where do I get the pointer to the dialog? Or the handle to the window? Could you recommend a sample project which does either of these? I have tried to implement various SendMessage.. / GetHandle.. procedures based on descriptions found on the web, but without success. I suppose I could just bundle all code into the *Dlg.cpp, that should work nicely.
Thanks.