06-20-2006, 12:05 PM
Dialog function is called directly by Windows. Windows cannot call member functions because it does not know the variable. Use intermediate UDF that retrieves variable address and calls member function.
Macro
Member function ClassDlg.ShowDlg
Member function ClassDlg.DlgProc
Function ClassDlg_DlgProc
Macro
Member function ClassDlg.ShowDlg
str controls = "4"
str c4Che
if(!ShowDialog("ClassDlg_DlgProc" &ClassDlg_DlgProc &controls 0 0 0 0 &this)) ret
Member function ClassDlg.DlgProc
function# hDlg message wParam lParam
;messages
sel message
,case WM_INITDIALOG ;;don't call DT_InitDialog!
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3 mes "Button"
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
Function ClassDlg_DlgProc
;\Dialog_Editor
function# hDlg message wParam lParam
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 10 10 48 14 "Button"
;4 Button 0x54012003 0x0 170 10 48 12 "Check"
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
ClassDlg* p=+DT_GetParam(hDlg)
if(p) p.DlgProc(hDlg message wParam lParam)