Reputation: 19
in Microsoft Foundation Class Library ,what is the difference value variables and control variables which are attached to graphic components ?
Upvotes: 1
Views: 2465
Reputation: 26279
Assuming you're asking about the way you attach variables to graphic controls in the Dialog Editor:
The "value" variables relate to the content of the control and the "control" variables relate to the control itself.
For example, for a CEdit
control, the content variable might be a CString
or an int
etc., which is a variable that may contain the content that the user has entered into the control (or the content you may wish to display), while the control variable will be a CEdit
instance that you can use to affect the control itself. For example to enable/disable input.
Note - please also read comments by @Vlad Feinstein, which correctly indicate that there is more to the dialog exchange mechanism than is encapsulated in this answer. My answer only clarifies the difference between the two types of variable mapping available from the dialog editor, which is what was originally asked. This answer is not (and will never be!) a tutorial on how to create and use dialogs in MFC.
Upvotes: 6