Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass value in dialog to #sub DlgProc
#1
Sorry for this akward simple question...

Below in "pass_value_dlg_test_calldlg_and_pass_value" I call the dialog "pass_value_dlg_test".
Is it possible to pass 'arr' into "#sub DlgProc" without using any scope related variables?

Function pass_value_dlg_test_calldlg_and_pass_value
Code:
Copy      Help
ARRAY(str) test
test[]="value 1"
test[]="value 2"
test[]="value 3"
test[]="value 4"
test[]="value 5"
test[]="value 6"
test[]="value 7"

pass_value_dlg_test(test)


Function pass_value_dlg_test
Code:
Copy      Help
function ARRAY(str)'arr

;; I do not want to use the below scope variable (thread global 'arr2')
ARRAY(str)- arr2=arr


str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret ;; <==== possible to pass 'arr' through here?


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,,;; I could place 'arr2' here but I do NOT want to use this method if possible
,,ARRAY(str)- arr2
,,int j
,,for j 0 arr2.len
,,,out arr2[j]
,,,
,,;; What I want is to output arr here WITHOUT using any scope related variables (global/static/thread)
,,;; It needs to get pass into 'DlgProc', is this possible? (how to do if possible...)
,,int i
,,for i 0 arr.len
,,,out arr[i]
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
#sub DlgProc v

Then arr can be used in DlgProc.

----
or

if(!ShowDialog(dd &sub.DlgProc 0 0 0 0 0 &arr)) ret
...
    case WM_INITDIALOG
        ARRAY(str)& arr=+DT_GetParam(hDlg)
#3
Thanks!!!
(I totally forgot about 'v' !)


Forum Jump:


Users browsing this thread: 1 Guest(s)