请帮我诊断一下!(50分)

  • 主题发起人 主题发起人 唐晓锋
  • 开始时间 开始时间

唐晓锋

Unregistered / Unconfirmed
GUEST, unregistred user!
我以前用过一次,不知道这回用为什么出现
"Left side cannot assigned to"
procedure TForm1.Button1Click(Sender: TObject);
var HHH:THandle;
ReadString:function :Integer;
begin
HHH:=LoadLibrary('NewReader.dll');
if HHH < 32 then
begin
ShowMessage('Not Found');
Exit;
end
else
begin
@HHH := GetProcAddress(HHH,'ReadString');
FreeLibrary(HHH);
end;
end;
 
试试改变 PROJECT/OPTIONS COMPILER页的 TYPE@OPERATOR.
 
唐晓峰,应该是这样的:
var
hhh : THandle;
readstring : TDllFunction;
begin
hDll := LoadLibrary( 'newreader.dll' );
if hDll < 32 then
//<=0
Raise Exception.Create( 'Load Library error:'
+ IntToStr( GetLastError ) );
try
@readstring := GetProcAddress( hhh, 'readstring' );
if not Assigned( readstring ) then
Raise Exception.Create( 'GetProc error:'
+ IntToStr( GetLastError ) );
Dll;
finally
FreeLibrary( hhh );
end;
 
主要是这一句:
<font color="#ff0000">@readstring := GetProcAddress( hhh, 'readstring' );</fong>
 
哦!谢谢!一时马虎!
 
后退
顶部