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

How to remove the combobox items during runtime

Hi,

I was experiencing issues while removing the combobox item during run time . I was able to select the combobox item and able to perform actions but upon clicking the next pages i was not able to remove the combobox item during the runtime . The below is the code where i was able to add the combobox item to the combobox property

Could someone please help me on removing the combobox item during the runtime ?

function PopulateComboBox(hInstall)
NUMBER nResult, index,nvSize;
HWND hDatabase,hCboView,hViewlist;
STRING sQuery,txtname1,txtname11,txtname111;
begin
hDatabase = MsiGetActiveDatabase(hInstall);
sQuery = "SELECT * FROM ComboBox WHERE Property='COMBOBOXONEVAL'";
//MessageBox("squery "+sQuery,INFORMATION);
nResult = MsiDatabaseOpenView(hDatabase, sQuery, hCboView);
MsiViewExecute(hCboView, NULL);
if (nResult = ERROR_SUCCESS) then
MsiGetProperty (hInstall, "NAME1", txtname1, nvSize);
MsiGetProperty (hInstall, "NAME11", txtname11, nvSize);
MsiGetProperty (hInstall, "NAME111", txtname111, nvSize);
AddCboEntry(hCboView, "COMBOBOXPERSONDETAILS", txtname1, txtname1, 1);
AddCboEntry(hCboView, "COMBOBOXPERSONDETAILS", txtname11, txtname11, 2);
AddCboEntry(hCboView, "COMBOBOXPERSONDETAILS", txtname111, txtname111, 3);
endif;
MsiViewClose(hCboView);
end;

function AddCboEntry(hView, szProperty, szText, szValue, nIndex)
NUMBER hRec;
NUMBER res;
begin
hRec = MsiCreateRecord(4);
res = MsiRecordSetString(hRec, 1, szProperty);
res = MsiRecordSetInteger(hRec, 2, nIndex);
res = MsiRecordSetString(hRec, 3, szText);
res = MsiRecordSetString(hRec, 4, szValue);
res = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
MsiCloseHandle(hRec);
end;

 

 

Labels (1)
0 Kudos
(1) Reply
kiran4545
Level 3

Could someone please help me on this ? This is the most Urgent and priority issue where we need to fix this immediately
0 Kudos