Einzelnen Beitrag anzeigen

Benutzerbild von RWarnecke
RWarnecke

Registriert seit: 31. Dez 2004
Ort: Stuttgart
4.408 Beiträge
 
Delphi XE8 Enterprise
 
#6

Re: WINAPI-Funktionen Windows Versionsabhängig

  Alt 22. Jan 2008, 18:32
Ich habe dazu noch eine Frage, kann ich an dem folgenden Beispiel noch etwas optimieren/verbessern ?
Delphi-Quellcode:
hclxwin32 := LoadLibrary('clxwin32.dll');
hnetwin32 := LoadLibrary('netwin32.dll');
hcalwin32 := LoadLibrary('calwin32.dll');
if (hclxwin32 <> 0) and (hnetwin32 <> 0) and (hcalwin32 <> 0) then
begin
  @CallsInit := GetProcAddress(hcalwin32, 'NWCallsInit');
  @ScanConnRefs := GetProcAddress(hclxwin32, 'NWCCScanConnRefs');
  @GetConnRefInfo := GetProcAddress(hclxwin32, 'NWCCGetConnRefInfo');
  @OpenConnByRef := GetProcAddress(hclxwin32, 'NWCCOpenConnByRef');
  @CreateContextHandle := GetProcAddress(hnetwin32, 'NWDSCreateContextHandle');
  @MapIDToName := GetProcAddress(hnetwin32, 'NWDSMapIDToName');
  if (@CallsInit <> nil) and (@ScanConnRefs <> nil) and
     (@GetConnRefInfo <> nil) and (@OpenConnByRef <> nil) and
     (@CreateContextHandle <> nil) and (@MapIDToName <> nil) then
  begin

    // irgendwelcher Code wird abgearbeitet

  end;
end;
Rolf Warnecke
App4Mission
  Mit Zitat antworten Zitat