⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 receiveunit.pas

📁 Delphi 7经典问题解析
💻 PAS
字号:
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.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -