A SERVICE OF

logo

In most cases, transferring data to or from a window is automatic, but you
Transferring the
can also explicitly transfer data at any time.
data
Transfer to a window happens automatically when you construct a
Transferring data to
window object. The constructor calls SetupWindow to create an interface
a window
element to represent the window object; it then calls TransferData to load
any data from the transfer buffer The window object’ SetupWindow calls. s
SetupWindow for each of its child windows as well, so each of the child
windows has a chance to transfer its data. Because the parent window sets
up its child windows in the order it constructed them, the data in the
transfer buffer must appear in that same order.
When a modal dialog box receives a command message with a control ID
Transferring data
of IDOK, it automatically transfers data from the controls into the transfer
from a dialog box
buffer Usually this message indicates that the user chose OK to close the.
dialog box, so the dialog box automatically updates its transfer buffer.
Then, if you execute the dialog box again, it transfers from the transfer
buffer to the controls.
Y u can explicitly transfer data in either direction at any time. For example,o
Transferring data
you might want to transfer data out of controls in a window or modeless
from a window
dialog box. Or you might want to reset the state of the controls using the
data in the transfer buffer in response to the user clicking a Reset or Revert
button.
Use the TransferData member function in either case, passing the tdSetData
enumeration to transfer from the transfer buffer to the controls or tdGetData
to transfer from the controls to the transfer buffer For example, you might.
want to call TransferData in the CloseWindow member function of a window
object:
void TMyWindow::CloseWindow()
{
TransferData(tdGetData);
TWindow::CloseWindow();
}
Y u might want to modify the way a particular control transfers its data, oro
Supporting transfer
to include a new control you define in the transfer mechanism. In either
for customized
case, all you need to do is to write a Transfer member function for your
controls
control object. See the following table to interpret the meaning of the
transfer flag parameter.
250
OWL P ogrammer’ Guider s