Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing variable values to a Dialog
#3
then to pass the variables into the Dlg control - like for use in various case statements (not controls), the only way I see is to re-define them as non-private thread-scope variables. Is this the correct way?
S

Macro Macro100
Code:
Copy      Help
int i = 100
str s = "Foo"
mac "CallTestDlg" 0  i s

Function CallTestDlg
Code:
Copy      Help
function i str's
int- tTestInt = i
str- tTestStr = s
str controls = "3"
str c3Che
if(!ShowDialog("TestDlg" &TestDlg &controls)) ret


Function TestDlg
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

int- tTestInt
str- tTestStr

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 Button 0x54012003 0x0 40 48 48 10 "Check"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,,mes F"{tTestInt} {tTestStr}"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)