cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Paul6151
Level 5

Populating a List Box

Hello!

I am using IsntallScript MSI Project.
I want to fill a listbox for Language select, but i get this NULL error:
here's my code:


listLanguage = CreateLanguageList();
if (listLanguage = LIST_NULL) then
MessageBox ("Unable to create list of languages", SEVERE);
abort;
endif;


which calls this procedure:


function CreateLanguageList()
LIST listLanguage;
begin
listLanguage = ListCreate (STRINGLIST);

if (listLanguage != LIST_NULL) then
ListAddString (listLanguage, "English (GB)", AFTER);
ListAddString (listLanguage, "English (US)", AFTER);
ListAddString (listLanguage, "Deutsch", AFTER);
endif;

return listLanguage;
end;


what's missing then?
Labels (1)
0 Kudos
(4) Replies
Paul6151
Level 5

i think the problem is in CtrlSetList:


nResult = CtrlSetList (szDialogName, SD_DLG_SEL_LANG_LIST, listLanguage);

if (nResult != 0) then
// Handle error from CtrlSetList.
MessageBox ("Unable to create folder name list.", SEVERE);
bDone = FALSE; //TRUE;
else
0 Kudos
Paul6151
Level 5

Does anyone familiar with this problem?

better yet, if you have made a successful use of CtrlSetList, can you teach us how, and maybe post the code? i saw the same problem on other resources too. This should work.

by the way, i am working with InstallScript MSI (IS 2010)
0 Kudos
RobertDickau
Flexera Alumni

Where are you calling CtrlSetList? In the DLG_INIT case of a custom dialog's code?
0 Kudos
Paul6151
Level 5

it worked in DLG_INIT!
thank you!

what i want to achieve now is to preserve the selected item.
right now, if i select "German" for the language, and i click Next that goes to another dialog. if i click "Back" on that dialog, it goes back to the language dialog but the selected item goes back to the default which is "English" in this case. It should still be "German"
0 Kudos