这段代码的问题在哪? ( 积分: 10 )

  • 主题发起人 主题发起人 动力汽车
  • 开始时间 开始时间

动力汽车

Unregistered / Unconfirmed
GUEST, unregistred user!
这是一个Unit单元的文件,编译的时候总是报:BEGIN expected but END found错误,但是我实在找不出哪里的begin跟end不匹配的,请各位帮我找找看,多谢

unit ShareMem;

interface

uses
Windows,SysUtils;

type
TShareData = integer;
PShareData = ^TShareData;
const
SHAREDATA_SIZE = SizeOf(TShareData);
MapFileNamw = 'DLLMemTest';


implementation

var
MapHandle:THandle;
ShareData:PShareData;
procedure OpenShareData;
procedure CloseShareData;

procedure OpenShareData;
begin
MapHandle := CreateFileMapping($FFFFFFFF,nil,PAGE_READWRITE,0,SHAREDATA_SIZE,MapFileNamw);
if MapHandle = 0 then
Raise Exception.Create('创建公用数据的Buffer不成功');
ShareData := MapViewOfFile(MapHandle,File_Map_Write,0,0,SHAREDATA_SIZE);
end;

procedure CloseShareData;
begin
UnMapViewOfFile(ShareData);
CloseHandle(MapHandle);
end;

procedure SetShareData(value:TShareData);stdcall;
begin
ShareData^:=value;
end;

function GetShareData:TShareData;stdcall;
begin
Result := ShareData^;
end;

procedure DLLEntryPoint(Reason:DWord);
begin
case Reason of
DLL_PROCESS_ATTACH:OpenShareData;
DLL_PROCESS_DETACH:CloseShareData;
end;
end;

end.
 
在哪一行报错?
 
procedure OpenShareData;
procedure CloseShareData;

implementation

var
MapHandle:THandle;
ShareData:PShareData;
 
接受答案了.
 

Similar threads

I
回复
0
查看
773
import
I
I
回复
0
查看
805
import
I
后退
顶部