Passing values from Form to Form
I need to pass some values (CString) from one CFormView/Doc to another in an MDI app. Can anyone comment on a good way to do this?
One way I thought of, would be to simply write to a temporary file on the hard drive on close of the CFormView/Doc which contains the original values then, on init of the new CFormView/Doc open the temp file, copy the values stored in it, delete the temp file and carry on from there. However, this seems rather labour intensive for such a simple operation. Anyone care to offer a quick explaination of a better way?
thanks,
chris.
[584 byte] By [
ckp] at [2007-11-16 13:45:48]

# 1 Re: Passing values from Form to Form
The easiest is to pass the view/document to the other by sending a message... if you use a user-message (WM_USER+value) you can pass the pointer to the view in the wParam, and the document in the lParam.
You could also have each view respond to a user defined (WM_USER+value) WM_GIVEMEYOURPOINTER message, and have it return the view/document pointer. You can then from any view request the data of any other view.
# 2 Re: Passing values from Form to Form
Thanks very much for the advice, I'll give it a try.
chris.
ckp at 2007-11-10 5:32:54 >
