I have this program, and have added code, and to eliminate this bug I remove or rem out that code but the bug is still there.
It all started when I put my LicenseAgreement code in under WM_INITDIALOG.
The licenseagreement opens a NEW dialog and user gets a choice of pressing I Accept or "I do not accept".
Choosing I accept does this
Dialog End CbHndl,1
Choosing I do NOT accept does this:
Dialog End CbHndl,0
Now, if they say "No", the LicenseAgreement function ends as it's supposed to and does a Function = RC (Rc is returned from the License Agreement callback via the Dialog End method)
Now, if th ey choose NO, the application stays in memory.
I did a Msgbox "DEBUG" at WM_DESTROY and it never gets there...
I've eliminated it to the code below that states if they do not agree then Dialog End CbHndl,0 for the MAIN program dialog box.
If I remove that line of code, the app obviously starts and ends properly.
Is there something about this? I also have a subclass in there, and even attempted to close it before closing the dialog, didn't matter.
I also tried destroying the font and brush before closing the dialog, didn't matter.
Why won't my program end if they don't choose to agree???
Thanks! and I'll post more code if necessary..
------------------
Scott
mailto:[email protected][email protected]</A>
It all started when I put my LicenseAgreement code in under WM_INITDIALOG.
The licenseagreement opens a NEW dialog and user gets a choice of pressing I Accept or "I do not accept".
Choosing I accept does this
Dialog End CbHndl,1
Choosing I do NOT accept does this:
Dialog End CbHndl,0
Now, if they say "No", the LicenseAgreement function ends as it's supposed to and does a Function = RC (Rc is returned from the License Agreement callback via the Dialog End method)
Now, if th ey choose NO, the application stays in memory.
I did a Msgbox "DEBUG" at WM_DESTROY and it never gets there...
I've eliminated it to the code below that states if they do not agree then Dialog End CbHndl,0 for the MAIN program dialog box.
If I remove that line of code, the app obviously starts and ends properly.
Is there something about this? I also have a subclass in there, and even attempted to close it before closing the dialog, didn't matter.
I also tried destroying the font and brush before closing the dialog, didn't matter.
Why won't my program end if they don't choose to agree???
Thanks! and I'll post more code if necessary..
Code:
Case %WM_INITDIALOG '------------------------------------------------------------------ 'COLOR STUFF hFont1 = MakeFont("Courier New", 10) GetObject hFont1, SizeOf(lf), ByVal VarPtr(lf) 'Make the text bold font or normal lf.lfWeight = %FW_BOLD Lb.lbStyle = %BLACK_BRUSH Control Send CbHndl,%IDLABEL4, %WM_SETFONT, hFont1, %TRUE '------------------------------------------------------------------ 'Subclass the text box Control Handle CbHndl, %IDTEXT2 To hText gOldSubClassProc = SetWindowLong(hText, %GWL_WNDPROC, CodePtr(SubClassProc)) If IsTrue Val(fh.PasswordFlag) Then Control Disable CbHndl,%IDBUTTON2 Control Set Text CbHndl, %IDTEXT1, Trim$(fh.UncompressPath) If IsTrue Val(fh.PasswordFlag) Then Control Set Focus CbHndl,%IDTEXT2 Else Control Set Focus CbHndl,%IDBUTTON2 End If Control Set Check CbHndl, %IDCHECK1, %TRUE Control Set Text hDlg,%IDTEXT1,Trim$(fh.UncompressPath) If IsTrue Val(fh.LicenseFlag) Then If IsFalse DisplayLicenseAgreement() Then MsgBox "You must agree to the license agreement before this file can be uncompressed", %MB_ICONSTOP,g_Python Dialog End CbHndl,1 End If End If
Scott
mailto:[email protected][email protected]</A>
Comment