Home > Back-end >  Could you tell me how to write this paragraph of DELPHI to BCB, please help to look at, thank you
Could you tell me how to write this paragraph of DELPHI to BCB, please help to look at, thank you

Time:09-17

The class function TADOTools. SaveToStream2 (
PvDataSet: TADODataSet) : TMemoryStream;
Var
AStream: _Stream;
V: OLEVariant;
P: Pointer;
The begin
AStream:=CoStream. Create;
OLEVariant (pvDataSet. You). The Save (AStream adPersistADTG);
AStream. Position:=0;
V:=AStream. Read (AStream. Size);
Result:=TMemoryStream. Create;
Try
P:=VarArrayLock (V);
Try
Result. The Size: VarArrayHighBound=(V, 1) + 1;
Move (P ^, result. ^, Memory result. The Size).
The finally
VarArrayUnLock (V);
end;
Except,
Result. The Free ();
Result:=nil;
Raise;
end;
end;

CodePudding user response:

The begin end is modified to {}
. Changed to - & gt;
: amended as==
  • Related