Lazarus安装Indy10控件
来源:互联网 发布:oppo手机usb共享网络 编辑:程序博客网 时间:2024/05/16 00:34
花了3个小时搞定Indy 10.2.0.3在Lazarus 0.9.29的安装。因为之前会报
Recompiling IdStreamVCL, checksum changed for IdGlobal
Unable to find file "IDStreamVCL.pas".这个错误。
这里只是简单的解决此类错误,也可以尝试其他方式进行修改:
http://www.lazarus.freepascal.org/index.php?topic=8813.0
修改了IDStreamVCL.pas,内容如下,重新编译即可正常使用Indy10控件
{
$Project$
$Workfile$
$Revision$
$DateUTC$
$Id$
$Project$
$Workfile$
$Revision$
$DateUTC$
$Id$
This file is part of the Indy (Internet Direct) project, and is offered
under the dual-licensing agreement described on the Indy website.
(http://www.indyproject.org/)
under the dual-licensing agreement described on the Indy website.
(http://www.indyproject.org/)
Copyright:
(c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
}
{
$Log$
}
(c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
}
{
$Log$
}
unit IdStreamVCL;
interface
{$I IdCompilerDefines.inc}
uses
Classes;
Classes;
type
TIdBytes = array of Byte;
TIdBytes = array of Byte;
TIdStreamHelperVCL = class
public
class function ReadBytes(
const AStream: TStream;
var VBytes: TIdBytes;
const ACount: Integer = -1;
const AOffset: Integer = 0) : Integer; {$IFDEF DOTNET} static; {$ENDIF}
class function Write(
const AStream: TStream;
const ABytes: TIdBytes;
const ACount: Integer = -1;
const AOffset: Integer = 0) : Integer; {$IFDEF DOTNET} static; {$ENDIF}
class function Seek(
const AStream: TStream;
const AOffset: Int64;
const AOrigin: TSeekOrigin) : Int64; {$IFDEF DOTNET} static; {$ENDIF}
end;
public
class function ReadBytes(
const AStream: TStream;
var VBytes: TIdBytes;
const ACount: Integer = -1;
const AOffset: Integer = 0) : Integer; {$IFDEF DOTNET} static; {$ENDIF}
class function Write(
const AStream: TStream;
const ABytes: TIdBytes;
const ACount: Integer = -1;
const AOffset: Integer = 0) : Integer; {$IFDEF DOTNET} static; {$ENDIF}
class function Seek(
const AStream: TStream;
const AOffset: Int64;
const AOrigin: TSeekOrigin) : Int64; {$IFDEF DOTNET} static; {$ENDIF}
end;
function IndyLength(const ABuffer: TIdBytes; const ALength: Integer = -1; const AIndex: Integer = 0): Integer;
function IndyMax(const AValueOne, AValueTwo: Integer): Integer;
function IndyMin(const AValueOne, AValueTwo: Integer): Integer;
function IndyMax(const AValueOne, AValueTwo: Integer): Integer;
function IndyMin(const AValueOne, AValueTwo: Integer): Integer;
implementation
function IndyMin(const AValueOne, AValueTwo: Integer): Integer;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
if AValueOne > AValueTwo then begin
Result := AValueTwo;
end else begin
Result := AValueOne;
end;
end;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
if AValueOne > AValueTwo then begin
Result := AValueTwo;
end else begin
Result := AValueOne;
end;
end;
function IndyMax(const AValueOne, AValueTwo: Integer): Integer;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
if AValueOne < AValueTwo then begin
Result := AValueTwo;
end else begin
Result := AValueOne;
end;
end;
{$IFDEF USEINLINE}inline;{$ENDIF}
begin
if AValueOne < AValueTwo then begin
Result := AValueTwo;
end else begin
Result := AValueOne;
end;
end;
function IndyLength(const ABuffer: TIdBytes; const ALength: Integer = -1; const AIndex: Integer = 0): Integer;
{$IFDEF USEINLINE}inline;{$ENDIF}
var
LAvailable: Integer;
begin
Assert(AIndex >= 0);
LAvailable := IndyMax(Length(ABuffer)-AIndex, 0);
if ALength < 0 then begin
Result := LAvailable;
end else begin
Result := IndyMin(LAvailable, ALength);
end;
end;
{$IFDEF USEINLINE}inline;{$ENDIF}
var
LAvailable: Integer;
begin
Assert(AIndex >= 0);
LAvailable := IndyMax(Length(ABuffer)-AIndex, 0);
if ALength < 0 then begin
Result := LAvailable;
end else begin
Result := IndyMin(LAvailable, ALength);
end;
end;
// RLebeau: must use a 'var' and not an 'out' for the VBytes parameter,
// or else any preallocated buffer the caller passes in will get wiped out!
// or else any preallocated buffer the caller passes in will get wiped out!
class function TIdStreamHelperVCL.ReadBytes(const AStream: TStream; var VBytes: TIdBytes;
const ACount, AOffset: Integer): Integer;
var
LActual: Integer;
begin
Assert(AStream<>nil);
Result := 0;
const ACount, AOffset: Integer): Integer;
var
LActual: Integer;
begin
Assert(AStream<>nil);
Result := 0;
if VBytes = nil then begin
SetLength(VBytes, 0);
end;
//check that offset<length(buffer)? offset+count?
//is there a need for this to be called with an offset into a nil buffer?
SetLength(VBytes, 0);
end;
//check that offset<length(buffer)? offset+count?
//is there a need for this to be called with an offset into a nil buffer?
LActual := ACount;
if LActual < 0 then begin
LActual := AStream.Size - AStream.Position;
end;
if LActual < 0 then begin
LActual := AStream.Size - AStream.Position;
end;
//this prevents eg reading 0 bytes at Offset=10 from allocating memory
if LActual = 0 then begin
Exit;
end;
if LActual = 0 then begin
Exit;
end;
if Length(VBytes) < (AOffset+LActual) then begin
SetLength(VBytes, AOffset+LActual);
end;
SetLength(VBytes, AOffset+LActual);
end;
Assert(VBytes<>nil);
Result := AStream.Read(VBytes[AOffset], LActual);
end;
Result := AStream.Read(VBytes[AOffset], LActual);
end;
class function TIdStreamHelperVCL.Write(const AStream: TStream; const ABytes: TIdBytes;
const ACount: Integer; const AOffset: Integer): Integer;
var
LActual: Integer;
begin
Result := 0;
Assert(AStream<>nil);
//should we raise assert instead of this nil check?
if ABytes <> nil then begin
LActual := IndyLength(ABytes, ACount, AOffset);
// TODO: loop the writing, or use WriteBuffer(), to mimic .NET where
// System.IO.Stream.Write() writes all provided bytes in a single operation
if LActual > 0 then begin
Result := AStream.Write(ABytes[AOffset], LActual);
end;
end;
end;
const ACount: Integer; const AOffset: Integer): Integer;
var
LActual: Integer;
begin
Result := 0;
Assert(AStream<>nil);
//should we raise assert instead of this nil check?
if ABytes <> nil then begin
LActual := IndyLength(ABytes, ACount, AOffset);
// TODO: loop the writing, or use WriteBuffer(), to mimic .NET where
// System.IO.Stream.Write() writes all provided bytes in a single operation
if LActual > 0 then begin
Result := AStream.Write(ABytes[AOffset], LActual);
end;
end;
end;
class function TIdStreamHelperVCL.Seek(const AStream: TStream; const AOffset: Int64;
const AOrigin: TSeekOrigin): Int64;
{$IFNDEF SIZE64STREAM}
const
cOrigins: array[TSeekOrigin] of Word = (soFromBeginning, soFromCurrent, soFromEnd);
{$ENDIF}
begin
{$IFDEF SIZE64STREAM}
Result := AStream.Seek(AOffset, AOrigin);
{$ELSE}
Result := AStream.Seek(AOffset and $FFFFFFFF, cOrigins[AOrigin]);
{$ENDIF}
end;
const AOrigin: TSeekOrigin): Int64;
{$IFNDEF SIZE64STREAM}
const
cOrigins: array[TSeekOrigin] of Word = (soFromBeginning, soFromCurrent, soFromEnd);
{$ENDIF}
begin
{$IFDEF SIZE64STREAM}
Result := AStream.Seek(AOffset, AOrigin);
{$ELSE}
Result := AStream.Seek(AOffset and $FFFFFFFF, cOrigins[AOrigin]);
{$ENDIF}
end;
end.
- Lazarus安装Indy10控件
- Lazarus(0.9.30)+ Indy10 系列(五)——安装Indy控件,重新编译Lazarus
- Lazarus控件安装方法
- Lazarus 中安装Grid++Report报表控件
- 如何安装Indy10
- Delphi7中安装Indy10
- indy10安装方法
- 如何安装indy10
- Lazarus 使用KbmMemTable控件
- Lazarus Gif控件
- linux下安装lazarus
- Puppy Linux安装lazarus
- ubuntu下安装Lazarus
- delphi7 手动安装 indy10.2.3
- delphi7 手动安装 indy10.2.3
- delphi7 手动安装 indy10.2.3
- delphi7 手动安装 indy10.2.3
- 为Lazarus控件指定图标
- 兼容 IE 和 FF 的换行 CSS 推荐样式
- ubuntu下卸载软件(两种方法)
- JavaScript的Cookies
- MySQL 关于连接池用完的问题和too many connection ----解决办法
- C#2.0 Socket套接字编程之实例初探
- Lazarus安装Indy10控件
- as3加密入门-4使用avm2内嵌式汇编指令混淆简介
- ASP.NET 2.0 Web Part编程入门(转)
- 我的学习方法观(待续)
- PB的环境参数设置
- Android应用开发详解
- as 关键字 应用
- 一次插入多条记录 [mysql]
- 流池不断无限增大的导致paused for flow control