Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.03 c
1-1147975944
anton773
2006-05-18 22:12
2006.06.25
Преобразование типов


9-1131334072
VolanD666
2005-11-07 06:27
2006.06.25
Как подсчитать FPS?


15-1149234197
Loginov Dmitry
2006-06-02 11:43
2006.06.25
Вопрос по Visual C 6.0


3-1146041888
Delphi basic
2006-04-26 12:58
2006.06.25
Crystal Peports из Delphi


2-1149661709
XTD
2006-06-07 10:28
2006.06.25
Как найти путь к моей программе?




   Наверх