Hallo,
ich habe versucht, ein altes Delphi6-Projekt unter XE5 zu kompilieren; allerdings werden dort fast alle Methoden, die unter Delphi 6 noch in Ordnung waren, als fehlerhaft dargestellt.
Anbei die fehlerhaften Methoden :
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7:
| function IsNetworkConnected: Boolean; begin if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then Result := True else Result := False; end; |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32:
| function GetIpAddressByName(const Lines: TStrings; const AHost: String) : Boolean; type PPInAddr = ^PInAddr; var WSA: TWSAData; HostInfo: PHostEnt; Addr: PPInAddr; begin Result := false; if WSAStartUp($101, WSA) = 0 then begin try HostInfo := getHostByName(PChar(AHost)); Result := HostInfo <> nil; if Result then begin Addr := Pointer(HostInfo^.h_addr_list); if (Addr <> nil) AND (Addr^ <> nil) then begin Repeat Lines.add(StrPas(inet_ntoa(Addr^^))); inc(Addr); Until Addr^ = nil; end; end; finally WSACleanup; end; end; end; |
und
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| function GetIPFromHost(const HostName: string): string; type TaPInAddr = array [0 .. 10] of PInAddr; PaPInAddr = ^TaPInAddr; var phe: PHostEnt; pptr: PaPInAddr; i: Integer; GInitData: TWSAData; begin WSAStartUp($101, GInitData); Result := ''; phe := getHostByName(PChar(HostName)); if phe = nil then Exit; pptr := PaPInAddr(phe^.h_addr_list); i := 0; while pptr^[i] <> nil do begin Result := inet_ntoa(pptr^[i]^); inc(i); end; WSACleanup; end; |
Kann es sein, dass sich die Sprache deutlich verändert hat?? Ich meine, dass gewisse Befehle veraltet sind, ist normal; dies kann die Fehler wohl kaum erklären... .
Ich könnte darüber Informationen brauchen.
LG,
Apo95