例如: public aa(String name,details) 返回一个aa对象,参数 字符型的name 和 details(对象数组) 现在是这样的,1、在delphi中如何定义 一个返回类型的对象把aa的值付给我自己定义的对象。2、delphi中 返回details型对象数组如何传递参数。 就着两个问题,谢谢了。
QQ:18399559
MSN:[email protected]
QQ:18399559
MSN:[email protected]
published
property xxx: TSomeType read Fxxx write Fxxx;
end;TArrayOfSomeObject = array of TSomeObject;以下是我的一个导出类 // ************************************************************************ //
// Namespace : ET
// ************************************************************************ //
TLine = class(TRemotable)
private
FName: WideString;
FVoltage: Integer;
published
property Name: WideString read FName write FName;
property Voltage: Integer read FVoltage write FVoltage;
end; TLineArray = array of TLine; { "urn:ETObjectIntf" } // ************************************************************************ //
// Namespace : urn:CategoryIntf-ILineMgr
// soapAction: urn:CategoryIntf-ILineMgr#%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// style : rpc
// binding : ILineMgrbinding
// service : ILineMgrservice
// port : ILineMgrPort
// URL : http://127.0.0.1:8081/ETSrvDBG.ETDBG/soap/ILineMgr
// ************************************************************************ //
ILineMgr = interface(IInvokable)
['{6CF0A2E0-FF92-1911-8AA5-A0CC6B951C0A}']
function List: TLineArray; stdcall;
procedure Append(var Value: TLine); stdcall;
procedure Change(const Id: Integer; const Value: TLine); stdcall;
end;而我实际定义的 { 所有基础数据基类 }
TETObject = class(TRemotable)
private
FId: Integer;
published
property Id: Integer read FId write FId;
end; { 分类对像基类 } TCategoryObject = class(TETObject)
private
FSortIdx: Integer;
published
property SortIdx: Integer read FSortIdx write FSortIdx;
end; { 线路 } TLine = class(TCategoryObject)
private
FName: string;
FVoltage: Integer;
public
constructor Create; override;
destructor Destroy; override;
published
property Name: string read FName write FName;
property Voltage: Integer read FVoltage write FVoltage;
end; TLineArray = array of TLine;
for i := 0 to 9 do
Details[i] := TSomeObject.Create;这里就可以设值后调用了, 但是完成后要显示释放for i := 0 to 9 do
Details[i].Free;
function aa(const in0: WideString; const in1: WideString; const in2: WideString; const in3: Integer; const in4: ArrayOfPropertyData): OperateResult; stdcall;
aa是个对象,ArrayOfPropertyData是个对象数组,我现在是想用delphi调用一下这个函数。现在怎么做??
in4: ArrayOfPropertyData
begin
...
SetLength(in4, 某len);
for i := 0 to 某len-1
begin
in4[i] := PropertyData.Create;
in4[i].xxx := xxx
end; 调用 for i := 0 to 某len-1
in4[i].Free;
...
end;
function aa(const in0: WideString; const in1: WideString; const in2: WideString; const in3: Integer; const in4: ArrayOfPropertyData): OperateResult; stdcall主要是aa的返回对象??
Temp: TObject
var
sql:String;
i:Integer;
Temp: TObject;
details: ArrayOfPropertyData;
begin SetLength(Details,10);
for i:=0 to 9 do
begin
Details[i]:= PropertyData.Create ;
Details[i].name:='YES';
Details[i].value:='NO';
end;
sql:=run.example('sdfsdf');
ShowMessage(sql);
Temp:=run.manageProduct('a','b','c',1,Details) ;//此句为什么有错误??