Incorrect Behavior With CtrlGetMLEText() Function

Incorrect Behavior With CtrlGetMLEText() Function


The CtrlGetMLEText() InstallScript function does not retrieve all text


The 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.


There was a bug found with the CtrlGetMLEText() function and it has been reported to InstallShield development. The bug is being tracked under [ISDEV-37676].


You 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 Information

For more information on the win api GetWindowTextLength().
For more information on the win api GetWindowText()
Was this article helpful? Yes No
No ratings
Version history
Revision #:
1 of 1
Last update:
‎Jul 09, 2018 10:10 PM
Updated by: