RichEdit20A control fails to load the License file...
Hi guys....
I hav an installer script which has 2 custom dialogs.......both of dem have a RichEdit20A each and are suppose to load individual files.....but the problem is the first dialog loads the file properly at first....after clicking continue on the first dialog the second dialog appears but it fails to load the file in the RichEdit20A control......after clicking on the back button of the second dialog even the first dialog fails to load the file....
.....any help wud be appreciated.... following is the code snippet from my script...
Page custom nsDialogsDirectory----->1st dialog
Page custom nsDialogsLicense--------->2nd dialog
PageEx custom
PageCallbacks PreIntouch
PageExEnd
.....................
.......................
Function nsDialogsDirectory
GetDlgItem $0 $HWNDPARENT 1
SendMessage $0 ${WM_SETTEXT} "0" "STR: Continue"
........................
.......................
GetDlgItem $0 $HWNDPARENT 1
EnableWindow $0 0
nsDialogs::Create /NOUNLOAD 1018
Pop $DIALOG
.........................
..........................
.........................
Call ShowPrivacyPolicy
nsDialogs::Show
FunctionEnd
Function nsDialogsLicense
GetDlgItem $0 $HWNDPARENT 1
SendMessage $0 ${WM_SETTEXT} "0" "STR: I agree"
;GetDlgItem $0 $HWNDPARENT 1
; EnableWindow $0 1
nsDialogs::Create /NOUNLOAD 1018
Call ShowLicense
nsDialogs::Show
FunctionEnd
Function ShowLicense
; GetDlgItem $0 $HWNDPARENT 1
; EnableWindow $0 1
File /oname=$PLUGINSDIR\amex-license.rtf "..\cpp\bin\amex-license.rtf"
nsDialogs::CreateControl /NOUNLOAD "RichEdit20A" ${ES_READONLY}|${WS_VISIBLE}|${WS_CHILD}|${WS_TABSTOP}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_WANTRETURN} ${WS_EX_STATICEDGE} 0 170 100% 79u ''
Pop $LICENSE
FileOpen $4 "$PLUGINSDIR\amex-license.rtf" r
StrCpy $0 $LICENSE
SendMessage $LICENSE ${EM_EXLIMITTEXT} 0 0x7fffffff
; set EM_AUTOURLDETECT to detect URL automatically
;Do not detect the links
;SendMessage $LICENSE 1115 1 0
System::Get /NoUnload "(i, i .R0, i .R1, i .R2) iss"
Pop $2
System::Call /NoUnload "*(i 0, i 0, k r2) i .r3"
System::Call /NoUnload "user32::SendMessage(i r0, i ${EM_STREAMIN}, i ${SF_RTF}, i r3) i.s"
loop:
Pop $0
StrCmp $0 "callback1" 0 done
System::Call /NoUnload "kernel32::ReadFile(i $4, i $R0, i $R1, i $R2, i 0)"
Push 0 # callback's return value
System::Call /NoUnload "$2"
goto loop
done:
System::Free $2
System::Free $3
FileClose $4
FunctionEnd
Showpriavcypolicy function is same as ShowLicense........am i doin sumthing wrong here?.....