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 Forum
- :
- Invalid characters in listbox
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Jun 01, 2011
02:00 AM
Invalid characters in listbox
hi,
We are trying to populate to listbox using
SendMessage
i.e like recursive calling of
Temp="Checking display";
SendMessage(hwndListBox,LB_ADDSTRING,0,&Temp);
nItems=SendMessage(hwndListBox,LB_GETCOUNT,0,0L)-1;
SendMessage(hwndListBox,LB_SETTOPINDEX,nItems,0L);
SendMessage(hwndListBox,LB_SETCURSEL,nItems,0);
SendMessage(hwndListBox,LB_SETHORIZONTALEXTENT,3000,0);
But i end up seeing some invalid characters in the listbox
(see the attachement. Note that the displayed string is not the exact one corresoponding to the above Temp message)
This stared after migrating the project from IS11.5 to IS2011 (just in case it might be the cause)
The install is being builded only for English locale.
Please reply in with your ideas
Thanks in advance
Maddy
We are trying to populate to listbox using
SendMessage
i.e like recursive calling of
Temp="Checking display";
SendMessage(hwndListBox,LB_ADDSTRING,0,&Temp);
nItems=SendMessage(hwndListBox,LB_GETCOUNT,0,0L)-1;
SendMessage(hwndListBox,LB_SETTOPINDEX,nItems,0L);
SendMessage(hwndListBox,LB_SETCURSEL,nItems,0);
SendMessage(hwndListBox,LB_SETHORIZONTALEXTENT,3000,0);
But i end up seeing some invalid characters in the listbox
(see the attachement. Note that the displayed string is not the exact one corresoponding to the above Temp message)
This stared after migrating the project from IS11.5 to IS2011 (just in case it might be the cause)
The install is being builded only for English locale.
Please reply in with your ideas
Thanks in advance
Maddy
(2) Replies
‎Jun 02, 2011
01:20 PM
This is likely a Unicode/ANSI API issue. There are a number of prototypes for SendMessage defined in the InstallScript headers. If these definitions are being used, please use USER.SendMessageA or USER.SendMessageW explicitly when passing strings as this will provide the InstallScript engine on more information on how to pass a string value when calling SendMessage.
If a custom prototype for SendMessage is being used instead of the built in InstallScript prototypes, the prototype needs to be corrected to pass an ANSI or Unicode string. The prototype should also explicitly contain which version of the API to call (SendMessageA/ANSI or SendMessageW/Unicode):
More information on changes made to the InstallScript engine in IS 2011 for Unicode support can be found in the release notes and help library.
If a custom prototype for SendMessage is being used instead of the built in InstallScript prototypes, the prototype needs to be corrected to pass an ANSI or Unicode string. The prototype should also explicitly contain which version of the API to call (SendMessageA/ANSI or SendMessageW/Unicode):
prototype number USER.SendMessageA(HWND, number, number, byref string);
prototype number USER.SendMessageW(HWND, number, number, byref wstring);
More information on changes made to the InstallScript engine in IS 2011 for Unicode support can be found in the release notes and help library.