
| Subject: | Environment Variables for Delphi 3 |
| Posted by: | Harvey Arkawy |
| Date: | Sun, 9 May 2010 |
I am using a program to protect my Delphi 3 executable from being copied or decompiled. The end product is password protected. That software adds various Environment Variables at runtime that my program is supposed to be able to use, such as the name of the License used, the days remaining before trial expires, the User's name of the registered user and others. The function call is GetEnvironmentVariable. The code to read this information is:
procedure TForm1.FormShow(Sender: TObject);
var S:String
begin
S:=StringOfChar(' ',256);
SetLength(S,GetEnviromentVariable('PROTECTED',Pchar(s),256));
ShowMessage(S);
end;
where 'PROTECTED' could be any one or more of 14 variables.
I am using Delphi 3 so the GetEnvironmentVariable function call bounces as an "Undeclared Identifier." It must have been added after my version as tech support for my protection program says that it functions under Delphi 4.
Question...
Is there a supplemental unit for Delphi 3 that I can use that has the GetEnvironmentVariable within or is there coding that I could add to one of my existing units that will do what GetEnvironmentVariable does?
Any assistance would be greatly appreciated!
Harvey