Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How remove items from ListBox


3 replies to this topic

Kiril

Kiril
  • Members
  • 39 posts

Posted 14 August 2001 - 11:42

Hi All,
I' am using Listbox in my dialog.
ListBox contains same items as in CustomSetup componets (show list of features). It's work fine until I come back to CustomSetup and change one of features state. I've got error 2878 from my dialog.
I think i need remove all old Items from ListBox before I fill it second time. But I don't know how.
Please help.

Kiril

Kiril
  • Members
  • 39 posts

Posted 14 August 2001 - 14:10

I solved problem with custom action when I call on back button:
hDatabase = MsiGetActiveDatabase(hMSI);
sQuery = "SELECT * FROM ListBox WHERE   Property='AUTHMETHODSLIST'";
MsiDatabaseOpenView(hDatabase, sQuery, hView);      
nResult = MsiViewExecute(hView, NULL);    
nResult = MsiViewFetch(hView, hRecord);
while(nResult = ERROR_SUCCESS)
MsiViewModify(hView, MSIMODIFY_DELETE,  hRecord);
nResult = MsiViewFetch(hView, hRecord);
endwhile;


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 15 August 2001 - 10:39

Why not

hDatabase = MsiGetActiveDatabase(hMSI);
sQuery = "DELETE * FROM ListBox WHERE   Property='AUTHMETHODSLIST'";
MsiDatabaseOpenView(hDatabase, sQuery, hView);    
MsiViewExecute(hView, NULL);
MsiViewClose(hView);