Incorrect Behavior With CtrlGetMLEText() Function
SummaryThe CtrlGetMLEText() InstallScript function does not retrieve all text
SymptomsThe CtrlGetMLEText() function should retrieve the contents of a multi-line edit field control in a custom InstallScript dialog. However depending on the string and length of string entered by the end user, the CtrlGetMLEText() function will not return the correct string list.
CauseThere was a bug found with the CtrlGetMLEText() function and it has been reported to InstallShield development. The bug is being tracked under [ISDEV-37676].
WorkaroundYou will have to avoid using the CtrlGetMLEText() function and instead use a function like GetWindowText(). You can use the sample code below to see how you can use this function in your InstallScript code to replace CtrlGetMLEText().
// Get handle to the custom dialog
hwndDlg = CmdGetHwndDlg(szDlg);
// Get handle to the multi-line edit control. MY_EDIT_CONTROL would be the control id.
hCtrl = CtrlGetDlgItem("", hwndDlg, MY_EDIT_CONTROL);
// Get the length of the text in edit control and resize the sText STRING variable.
nLen = GetWindowTextLength(hCtrl);
Resize(sText, nLen + 1);
if (GetWindowText(hCtrl, sText, nLen + 1)>0) then
// Entire text will be retrieved into the sText.
// May want to consider removing CR/LF characters here.
// No text was retrived, empty string.
Additional InformationFor more information on the win api GetWindowTextLength().
For more information on the win api GetWindowText()