cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Techmaddy
Level 3

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
Labels (1)
0 Kudos
(2) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

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):

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.
0 Kudos
Techmaddy
Level 3

Thanks for the reply.
I will try that out.

Thanks
0 Kudos