Jan_Cieslicki
05-19-2003, 05:30 AM
I am trying to use new Background Downloading function of Update Srvice ver.2.0 with Delphi. I tried to modify VB example given:
......
var
UpdateAgent : IAgentEx;
UpdateCollection : IUpdates;
WithEvents,UpdateInstance : IUpdate;
iIndex : integer;
begin
UpdateAgent := CoAgent.Create;
if UpdateAgent.IsConnectedEx(pszProductCode) then
begin
UpdateCollection := UpdateAgent.EnumUpdates(pszProductCode);
For iIndex := 1 To UpdateCollection.Count do
begin
UpdateInstance := UpdateCollection.Item[iIndex];
If (UpdateInstance.IsNextUse = True) Then
If (UpdateInstance.Download(True) = True) Then
UpdateInstance.Execute;
End;
end;
but I am getting Delphi error message for the line in red, saying that I cannot assign UpdateInstance IUpdate object to an OLE Variable UpdateCollection.Item[iIndex].
Can anyone help?
......
var
UpdateAgent : IAgentEx;
UpdateCollection : IUpdates;
WithEvents,UpdateInstance : IUpdate;
iIndex : integer;
begin
UpdateAgent := CoAgent.Create;
if UpdateAgent.IsConnectedEx(pszProductCode) then
begin
UpdateCollection := UpdateAgent.EnumUpdates(pszProductCode);
For iIndex := 1 To UpdateCollection.Count do
begin
UpdateInstance := UpdateCollection.Item[iIndex];
If (UpdateInstance.IsNextUse = True) Then
If (UpdateInstance.Download(True) = True) Then
UpdateInstance.Execute;
End;
end;
but I am getting Delphi error message for the line in red, saying that I cannot assign UpdateInstance IUpdate object to an OLE Variable UpdateCollection.Item[iIndex].
Can anyone help?