Posts: 576
Threads: 97
Joined: Aug 2007
My dialog runs a different dialog on the press of a button but then closes itself right after it, i think it closes the one that it opened also...anyway to make it not close the second one?
It only happens in exe...
Examples...
.qml file...
New Folder.qml (Size: 1.48 KB / Downloads: 374)
once you make it into exe it closes both of them but in qm it only closes the first one like its suppose to
Posts: 12,073
Threads: 140
Joined: Dec 2002
mac starts another thread. Then main thread exits. When main thread exits, program ends. Somehow make that main thread would not exit, eg wait for dialog2. Or don't use mac, let dialog2 run in the same thread.
Posts: 576
Threads: 97
Joined: Aug 2007
ok i used wait for the second dialog to open, but it still closes both of them when i use clo hDlg to close the second one.
Posts: 12,073
Threads: 140
Joined: Dec 2002
wait for the second dialog to CLOSE
Posts: 576
Threads: 97
Joined: Aug 2007
how would i go about making dialog2 run in a thread and NOT close dialog2 when dialog1 closes.
Posts: 12,073
Threads: 140
Joined: Dec 2002
you better hide dialog1, don't close
Posts: 12,073
Threads: 140
Joined: Dec 2002
closing example
Function
dlg_564_main
;/exe
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
ShowDialog("dlg_564_main" &dlg_564_main 0)
rep
,1
,if(IsThreadRunning("dlg_564_2")) continue
,;if(IsThreadRunning("dlg_564_3")) continue
,;if(IsThreadRunning("dlg_564_4")) continue
,;...
,break
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog main"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 12 10 48 14 "dialog2"
;END DIALOG
;DIALOG EDITOR: "" 0x2030006 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "dlg_564_2"
,clo hDlg
,
,case IDOK
,case IDCANCEL
ret 1
Posts: 576
Threads: 97
Joined: Aug 2007
i figured out a way using hide, i will try using the IsThreadRunning and see if i can get that.
thanks
Posts: 27
Threads: 8
Joined: Jul 2008
i have exactly the same problem, ive tried all diffrent ways to try close or hide it,il try the "IsThreadRunning" example,did you figure out how to hide the first dialog QM_Expert other then the "IsThreadRunning"?
VεRiTλS™
Posts: 28
Threads: 12
Joined: Apr 2008
make your first dialog, then make your second dialog, then call your second dialog as a mac from a control of the first dialog, to fix the problem with the first dialog closing do this in second dialog:
sel message
,case WM_INITDIALOG
,hid win("YOU FIRST DIALOG NAME HERE" "#32770")
,DT_Init(hDlg lParam) ;;*
,ret 1 ;;*
,case WM_DESTROY DT_DeleteData(hDlg) ;;*
,res win("YOU FIRST DIALOG NAME HERE" "#32770")
,case WM_COMMAND goto messages2
this will allow the first dialog to hide when the second dialog opens and it will unhide when second dialog closes!
hope this helps!