Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ifi
#1
ifi doesnt seem to be recognising a window no longer exists is there a better function to use
Function Function
Code:
Copy      Help
str t
int ttt
foreach t tt
,ifi(win(t))
,,ttt=win(t)
,,mac "SetToolbar" ttt
,,goto next
,tt.findreplace(t "" 8)
,tt.findreplace("[][]" "[]" 8)
,;next
out tt
1

outputs old window names after they are gone
#2
Here use if, not ifi.
If win returns not 0, the window exists.

Macro Macro1551
Code:
Copy      Help
str tt=
;window1
;window2

str t ttNew
int ttt
foreach t tt
,ttt=win(t)
,if ttt
,,mac "SetToolbar" ttt
,,ttNew.addline(t)
tt=ttNew
out tt
1
#3
thankyou
#4
where is the problem here please i have isolated it as much as i can dialog closes very fast with no error/Error (RT) in DT_SetControls: Exception 0xC0000005. Access violation. Cannot read memory at 0x10050E. In qm.exe at 0x46BE14 (0x400000+0x6BE14).
i think it may be SetTimer with it being a memory error. first time i have ever used this function so more than likely. I am trying to attach the dialog to the owner dialog. I have done this before but lots more code than i think it can be done.

Function Dialog3
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
str dd=
;BEGIN DIALOG
;0 "" 0xA40 0x190 0 0 88 10 "Dialog"
;END DIALOG
;DIALOG EDITOR: "" 0x2030207 "" "" ""
if(!ShowDialog(dd &Dialog3)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,int t4=GetParent(hDlg)
,SetTimer hDlg 1 500 0
,case WM_TIMER
,,case 1
,,int t4=GetParent(hDlg)
,,if !t4
,,,DestroyWindow hDlg; ret
,,int x y cx cy; GetWinXY t4 x y cx cy
,,mov x y hDlg
,,if(IsIconic(t4))
,,,min hDlg
,,ifa(t4)
,,,ont hDlg
,,else
,,,ont- hDlg
,case WM_DESTROY
,case WM_COMMAND goto messages2
;messages2
sel wParam
,;messages3
,case IDCANCEL
ret 1
#5
This code runs without errors.

Possibly dialog variables don't match dialog definition. Run dialog editor, Apply, and update dialog code.
#6
now i get a new error Error (RT) in DT_Init: window not found. I am going to try redownloading qm.
#7
i fixed it now this line was causing errors
,,int t4=GetParent(hDlg)
,,if !t4


Forum Jump:


Users browsing this thread: 1 Guest(s)