Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.06.25;
Скачать: CL | DM;

Вниз

Использование интерфейсов в KOL   Найти похожие ветки 

 
Алексей Ефременко   (2005-10-12 11:49) [0]

Необходимо работать со структурированным файлом через интерфейсы IStorage и IStream. Однако, подключение к проекту модуля activex.pas наверняка потянет в KOL-проект "старые добрые" class-ы и весь тот балласт, от которого стремишся избавиться, переходя на KOL. Я верно рассуждаю? И есть ли выход из этого положения? Есть ли лазейка для использования interface в KOL?


 
shalex ©   (2005-10-12 11:53) [1]

activex.pas не относится к VCL, поэтому можно подключать.


 
ECM ©   (2005-10-12 11:57) [2]

Посмотрите в сторону http://bonanzas.rinet.ru/ActiveKOL.zip
может облегчить задачу


 
Thaddy   (2005-10-13 00:04) [3]

I have KOL pStream wrappers for IStream and IStorage if you want. Just mail me.


 
Thaddy   (2005-10-13 01:59) [4]


function OleStreamSeek(Strm: PStream; MoveTo: Integer; MoveMethod: TMoveMethod ): DWORD;
var
 Pos: Largeint;
begin
 ISTREAM(Strm.methods.fcustom).Seek(Moveto, integer(MoveMethod), Pos);
 Result := Longint(Pos);
end;

function OleStreamRead(Strm: PStream; var Buffer; Count: DWORD ): DWORD;
begin
 ISTREAM(Strm.methods.fCustom).Read(@Buffer, Count, @Result)
end;

function OleStreamWrite( Strm: PStream; var Buffer; Count: DWORD ): DWORD;
begin
 result:=ISTREAM(Strm.methods.fcustom).write(@Buffer, Count, @Result)
end;

function NewOleStream(const OleStream:iStream):pStream;
var
  Methods:TStreamMethods;
begin
Result:=_NewStream(Methods);
Result.Methods.fSeek:=OleStreamSeek;
Result.Methods.fRead:=OleStreamRead;
Result.Methods.fWrite:=OleStreamWrite;
Result.Methods.fCustom:=Pointer(OleStream);
end;

end.
constructor TOleStream.Create(const Stream: IStream);
begin
 FStream := Stream;
end;

function TOleStream.Read(var Buffer; Count: Longint): Longint;
begin
 OleCheck(FStream.Read(@Buffer, Count, @Result));
end;

function TOleStream.Seek(Offset: Longint; Origin: Word): Longint;
var
 Pos: Largeint;
begin
 OleCheck(FStream.Seek(Offset, Origin, Pos));
 Result := Longint(Pos);
end;

function TOleStream.Write(const Buffer; Count: Longint): Longint;
begin
 OleCheck(FStream.Write(@Buffer, Count, @Result));
end;

function TOleStream.GetIStream: IStream;
begin
 Result := FStream;
end;


 
Thaddy   (2005-10-13 14:28) [5]

http://members.chello.nl/t.koning8/kolcompdoc.pas

This contains a complete and full featured set of objects to work with storages and streams for KOL.

Please note that the included filesystem is broken, but the IStorage and Istream objects work, as do the utility routines (many ;) )



Страницы: 1 вся ветка

Текущий архив: 2006.06.25;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.042 c
2-1149687624
mfender
2006-06-07 17:40
2006.06.25
TWebBrowser: перехват собитий (OnMouseDown)


2-1149490302
novice
2006-06-05 10:51
2006.06.25
Контроль работы приложения на уд. компе


3-1145965808
Alpine
2006-04-25 15:50
2006.06.25
Проблемма с UPPER(FIELD) LIKE .... в IB 7.01


2-1149450252
ZV
2006-06-04 23:44
2006.06.25
???


15-1149167212
Курдль
2006-06-01 17:06
2006.06.25
Прощай, Delphi! (Не про политику Borland)