unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TMyRecord = record
IntBuffer: array[0..31] of Integer;
CharBuffer: array[0..127] of Char;
lpszInput: LPTSTR;
lpszOutput: LPTSTR;
end;
var
Form2: TForm2;
s1,s2: TStringStream;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
showmessage('hello 2018');
s1 := TStringStream.Create;
s2 := TStringStream.Create;
{向第一个字符串流写入}
s1.WriteString('万一的 Delphi 博客');
ShowMessage(s1.DataString); {万一的 Delphi 博客}
{设置第二个字符串流的大小}
s2.SetSize(10);
{从第一个流复制到第二个流}
CopyMemory(s2.Memory, s1.Memory, s2.Size);
ShowMessage('s2:' + s2.DataString); {万一的}
copyMemory(s2.Memory,s1.Memory,s1.Size);
showMessage('20180909: '+ IntToStr(s1.Size));
s1.Free;
s2.Free;
{CopyMemory(str:String,sor:pointer,99);}
end;
//function GetText(Window: HWND; BufSize: Integer = 1024): string;
end.