Posts: 1,338
Threads: 61
Joined: Jul 2006
I was trying to edit a dialog created with an older version of qm but latest version of qm does not find dialog procedure.Is there a way to fix this? or must i recreate the entire dialog procedure using #sub DlgProc?
Posts: 12,097
Threads: 142
Joined: Dec 2002
Does not find when dialog definition is in other function than dialog procedure. Most old dialogs probably have them in the same function. For others, move dialog definition (BEGIN DIALOG...END DIALOG...DIALOG EDITOR...) to the function where is the dialog procedure. Or use #sub DlgProc.
Posts: 1,338
Threads: 61
Joined: Jul 2006
procedure and definitions are in same function already
Posts: 12,097
Threads: 142
Joined: Dec 2002
Probably some code is not standard, and QM fails to parse.
Tested:
Works:
Function
dlg_button4
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("dlg_button4" &dlg_button4)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 18 16 48 14 "Button3"
;4 Button 0x54032000 0x0 18 36 48 14 "Button4"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Works:
Function
dlg_button6
;\Dialog_Editor
function# hDlg message wParam lParam
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 18 16 48 14 "Button3"
;4 Button 0x54032000 0x0 18 36 48 14 "Button4"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Doesn't:
Function
dlg_button5
;\Dialog_Editor
if(!ShowDialog("dlg_button5" &dlg_button6)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 18 16 48 14 "Button3"
;4 Button 0x54032000 0x0 18 36 48 14 "Button4"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""
Doesn't:
Function
dlg_button5
;\Dialog_Editor
if(!ShowDialog("dlg_button6" &dlg_button6)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 18 16 48 14 "Button3"
;4 Button 0x54032000 0x0 18 36 48 14 "Button4"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "" "" ""