Discussion:
What is a simple way of passing a value to a new dialog box in visual c?
(too old to reply)
g***@hotmail.com
2015-03-18 13:45:41 UTC
Permalink
I generated a new dialog box and need a simple way to pass a variable to the new static text called IDC_TEXT in this dialog box?
Woody
2015-03-19 05:58:49 UTC
Permalink
Post by g***@hotmail.com
I generated a new dialog box and need a simple way to pass a variable to the new static text called IDC_TEXT in this dialog box?
In general, for controls are two standard ways for doing so:
1) Use the Dialog Data Exchange (DDX), which transfers data to or from a control.
2) Get a pointer to the control and use SetWindowText.

For a static control, I don't think (1) is applicable (for transferring text). So, for (2), you would get a CStatic * to your control by using either GetDlgItem(IDC_Text), or by using DDX to get a "control variable". The latter can be done easily using Visual Studio's Class Wizard, or just right-click the control in the Dialog Editor and choose "Add variable".
Guskz Kz
2015-03-19 20:42:15 UTC
Permalink
Post by Woody
Post by g***@hotmail.com
I generated a new dialog box and need a simple way to pass a variable to the new static text called IDC_TEXT in this dialog box?
1) Use the Dialog Data Exchange (DDX), which transfers data to or from a control.
2) Get a pointer to the control and use SetWindowText.
For a static control, I don't think (1) is applicable (for transferring text). So, for (2), you would get a CStatic * to your control by using either GetDlgItem(IDC_Text), or by using DDX to get a "control variable". The latter can be done easily using Visual Studio's Class Wizard, or just right-click the control in the Dialog Editor and choose "Add variable".
Great thanks Woody!

Continue reading on narkive:
Search results for 'What is a simple way of passing a value to a new dialog box in visual c?' (Questions and Answers)
5
replies
how to access Internet throw mobile phone to PC? pls tell me names of mobiles?
started 2007-03-13 04:14:49 UTC
internet
Loading...