L
luogt
Unregistered / Unconfirmed
GUEST, unregistred user!
各位老兄:
请看下面这段代码:
var
wsadata: TWSAData;
begin
if WSAStartup($101,wsadata) <> 0 then begin
ShowMessage(‘Error initialising WinSock’);
halt;
end;
hICMPlib ∶= loadlibrary(icmpDLL);
if hICMPlib <> null then begin
@ICMPCreateFile ∶= GetProcAddress(hICMPlib, ‘IcmpCreateFile’);
@IcmpCloseHandle∶= GetProcAddress(hICMPlib, ‘IcmpCloseHandle’);
@IcmpSendEcho∶= GetProcAddress(hICMPlib,
‘IcmpSendEcho’);
if (@ICMPCreateFile = Nil) or (@IcmpCloseHandle = Nil) or (@IcmpSendEcho=Nil) then begin
ShowMessage(‘Error loading dll functions’);
halt;
end;
hICMP ∶= IcmpCreateFile;
if hICMP=INVALID_HANDLE_VALUE then begin
ShowMessage(‘Unable to get ping handle’);
halt;
end;
end;
else begin
ShowMessage(‘Unable to register’+ icmpDLL);
halt;
end;
end;
请问ICMPCreateFile、IcmpCloseHandle、IcmpSendEcho应该申明成什么类型的变量?
请看下面这段代码:
var
wsadata: TWSAData;
begin
if WSAStartup($101,wsadata) <> 0 then begin
ShowMessage(‘Error initialising WinSock’);
halt;
end;
hICMPlib ∶= loadlibrary(icmpDLL);
if hICMPlib <> null then begin
@ICMPCreateFile ∶= GetProcAddress(hICMPlib, ‘IcmpCreateFile’);
@IcmpCloseHandle∶= GetProcAddress(hICMPlib, ‘IcmpCloseHandle’);
@IcmpSendEcho∶= GetProcAddress(hICMPlib,
‘IcmpSendEcho’);
if (@ICMPCreateFile = Nil) or (@IcmpCloseHandle = Nil) or (@IcmpSendEcho=Nil) then begin
ShowMessage(‘Error loading dll functions’);
halt;
end;
hICMP ∶= IcmpCreateFile;
if hICMP=INVALID_HANDLE_VALUE then begin
ShowMessage(‘Unable to get ping handle’);
halt;
end;
end;
else begin
ShowMessage(‘Unable to register’+ icmpDLL);
halt;
end;
end;
请问ICMPCreateFile、IcmpCloseHandle、IcmpSendEcho应该申明成什么类型的变量?