I am compiling my application in Delphi XE2.It was developed in delphi 7.. My code is as follows:
type
Name = array[0..100] of PChar;
PName = ^Name;
var
HEnt: pHostEnt;
HName: PName;
WSAData: TWSAData;
i: Integer;
begin
Result := False;
if WSAStartup($0101, WSAData) <> 0 then begin
WSAErr := 'Winsock is not responding."';
Exit;
end;
IPaddr := '';
New(HName);
if GetHostName(HName^, SizeOf(Name)) = 0 then <-----ERROR
begin
HostName := StrPas(HName^);
HEnt := GetHostByName(HName^);
"
"
so on...
end;
When i try to compile the code ,i get the following error:
When i try this code in another application it works fine in Delphi 7. How do i convert from character pointer to PAnsiChar type to make it run on Delphi XE2??.