Receiveunit.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:1k
- unit Receiveunit;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, Buttons, ExtCtrls;
- type
- TForm1 = class(TForm)
- Edit1: TEdit;
- Label1: TLabel;
- Timer1: TTimer;
- procedure Timer1Timer(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Timer1Timer(Sender: TObject);
- var
- MapPointer:Pointer;
- begin
- if (OpenFileMapping(FILE_MAP_ALL_ACCESS,False,'MapFileDemo')<>0) then
- begin
- MapPointer:=MapViewOfFile(OpenFileMapping(FILE_MAP_ALL_ACCESS,False,'MapFileDemo'),FILE_MAP_ALL_ACCESS,0,0,0);
- Edit1.Text := PChar (MapPointer);//从共享内存读出内容
- end;
- end;
- end.