![]() |
Delphi 5: sysutils.GetEnvironmentVariable?
Hallo,
ich habe hier ein Delphi-Projekt (offenbar D7?) mit folgendem Code-Ausschnitt:
Delphi-Quellcode:
Beim Kompilieren mit D5 erscheint der Fehler 'Undefinierter Bezeichner: GetEnvironmentVariable'. :shock:
..if fileexists(sysutils.GetEnvironmentVariable('temp')+'\registry_bak.REG') then..
In der Hilfe ist auch in der Unit sysutils dazu nichts zu finden. Meine Frage ist nun, wie kann ich ohne diese Funktion an den benötigten Pfad kommen? :?: |
Re: Delphi 5: sysutils.GetEnvironmentVariable?
Hallo,
du kannst die Windows API Funktion auch selbst kapseln:
Delphi-Quellcode:
Grüße vom marabu
function GetEnvVar(const varName: string): string;
var nSize: DWORD; begin nSize := GetEnvironmentVariable(PChar(varName), @Result[1], 0); SetLength(Result, nSize); GetEnvironmentVariable(PChar(varName), @Result[1], nSize); end; |
Re: Delphi 5: sysutils.GetEnvironmentVariable?
Super!!!
Danke, es funktioniert!! :???: :thumb: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:52 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz