PDA

View Full Version : Dynamically fill of list box



>Wolf<
04-26-2004, 10:42 AM
Hello,

i have to fill up a list box with the program folder names at run time. I have a basic msi project. I tried the sample of Q103295 and it works. But how can i step thru a list to set the folder names in VBScript?

I tried also following code:
hDatabase = MsiGetActiveDatabase(hMSI);
nResult = MsiDatabaseOpenView(hDatabase, "SELECT * FROM 'ListBox' where Property='LISTBOXPROP'", hView);

for iCount = 1 to 10

NumToStr(svCount, iCount);

hRec = MsiCreateRecord(4);
MsiRecordSetString(hRec, 1, "FOLDER_PROGRAMS_LIST"); // Column1: Property tied to the entry
MsiRecordSetInteger(hRec, 2, iCount); // Column2: Display order of the item
MsiRecordSetString(hRec, 3, "test"); // Column3: Value to set property to
MsiRecordSetString(hRec, 4, "test"); // Column4: Display text for item
MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
MsiCloseHandle(hRec);
endfor;

MsiViewClose(hView);

but this doesn't work too.

Can anybody help me maybe with a working example

Thanks in advance
Wolf

>Wolf<
04-26-2004, 10:43 AM
Ohh sorry:

folowing line is the line i used

MsiRecordSetString(hRec, 1, "LISTBOXPROP"); // Column1: Property tied to the entry

>Wolf<
04-27-2004, 08:31 AM
Found it out.