оригинал: автор Henri Gourvest, http://www.progdigy.com/?page_id=13
Преобраз. с помощью "Сервис -> Преобр. модуль Delphi в Lazarus -> Lazarus для Windows"
- Код: Выделить всё
- procedure SetCardinalProperty(arch: I7zOutArchive; const name: UnicodeString; card: Cardinal);
 var
 value: OleVariant;
 begin
 -> TPropVariant(value).vt := VT_UI4;
 -> TPropVariant(value).ulVal := card;
 arch.SetPropertie(name, value);
 end;
 function T7zCodec.GetDecoder(const index: integer): ICompressCoder;
 var
 v: OleVariant;
 begin
 v := MethodProperty[index, kDecoder];
 -> CreateObject(TPropVariant(v).puuid^, ICompressCoder, Result);
 end;
 function T7zCodec.GetEncoder(const index: integer): ICompressCoder;
 var
 v: OleVariant;
 begin
 v := MethodProperty[index, kEncoder];
 -> CreateObject(TPropVariant(v).puuid^, ICompressCoder, Result);
 end;
 function T7zArchive.GetLibGUIDProperty(const Index: NArchive): TGUID;
 var
 v: OleVariant;
 begin
 v := HandlerProperty[index];
 -> Result := TPropVariant(v).puuid^;
 end;
 function T7zOutArchive.GetProperty(index: Cardinal; propID: PROPID;
 var value: OleVariant): HRESULT;
 var
 item: T7zBatchItem;
 begin
 item := T7zBatchItem(FBatchList[index]);
 case propID of
 kpidAttributes:
 begin
 -> TPropVariant(Value).vt := VT_UI4;
 -> TPropVariant(Value).ulVal := item.Attributes;
 end;
 kpidLastWriteTime:
 begin
 -> TPropVariant(value).vt := VT_FILETIME;
 -> TPropVariant(value).filetime := item.LastWriteTime;
 end;
 kpidPath:
 begin
 if item.Path <> '' then
 value := item.Path;
 end;
 kpidIsFolder: Value := item.IsFolder;
 kpidSize:
 begin
 -> TPropVariant(Value).vt := VT_UI8;
 -> TPropVariant(Value).uhVal.QuadPart := item.Size;
 end;
 kpidCreationTime:
 begin
 -> TPropVariant(value).vt := VT_FILETIME;
 -> TPropVariant(value).filetime := item.CreationTime;
 end;
 kpidIsAnti: value := item.IsAnti;
 else
 // beep(0,0);
 end;
 Result := S_OK;
 end;
 procedure T7zOutArchive.SetPropertie(name: UnicodeString;
 value: OleVariant);
 var
 intf: ISetProperties;
 p: PWideChar;
 begin
 intf := OutArchive as ISetProperties;
 p := PWideChar(name);
 -> RINOK(intf.SetProperties(@p, @TPropVariant(value), 1));
 end;
При компиляции грешит на
- Код: Выделить всё
- TPropVariant(value).filetime := item.LastWriteTime;
с ошибкой "sevenzip.pas(1535,9) Error: Illegal type conversion: "OleVariant" to "<record type>"". И это не одна такая ошибка. Вопрос: преобразуем ли этот модуль. Если да, то как...
Для удобства даны полностью процедуры (функции), а значком "->" помечено, на что жалуется...







