This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- Incorrect Behavior With CtrlGetMLEText() Function
Subscribe
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Incorrect Behavior With CtrlGetMLEText() Function
Incorrect Behavior With CtrlGetMLEText() Function
Summary
The CtrlGetMLEText() InstallScript function does not retrieve all textSymptoms
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.Cause
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].Workaround
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.
else
// No text was retrived, empty string.
endif;
Additional Information
For more information on the win api GetWindowTextLength().For more information on the win api GetWindowText()
No ratings