Vielleicht kommt EurekaLog nur nicht mit sowas klar
in einer Funktion reservieren und wo anders freigeben (vorallem wenn man dieses über lokale Variablen erledigt).
Ich hätt es in etwa so gemacht (k.A. ob EurekaLog dieses nun mag).
Finde es so auch übersichtlicher, da man nun nicht gucken muß, was mit den lokalen variavblen passiert, bzw. wie die wo verwenden werden.
Delphi-Quellcode:
procedure TTC7AutoStart.CreateAutoStartStruc(var AutoStartStruc: TTC7AutoStartStruc);
{
Setzt die Daten eines AutoStartStruc auf definierte Anfangswerte.
}
begin
AutoStartStruc := TTC7AutoStartStruc.Create;
with AutoStartStruc do begin
Index := -1;
EntryType := asUndefined;
AutoStartDangerLevel := dlMiddle;
UniqueID := '';
IconCacheIndex := -1;
DeterminedFile := '';
Status := stEnabled;
HasEncyclopediaEntry := false;
EncyclopediaInfo := TTC7EncyclopediaData.Create;
with EncyclopediaInfo do begin
PrimaryID := '';
SecondIDList := '';
Caption := '';
Teaser := '';
Description := '';
CreateDate := '';
DangerLevel := 1; //entspricht dlMiddle
end;
with DeterminedFileInfo do begin
CompanyName := '';
FileDescription := '';
FileVersion := '';
InternalName := '';
LegalCopyright := '';
LegalTrademarks := '';
OriginalFilename := '';
ProductName := '';
ProductVersion := '';
Comments := '';
end;
with FileData do begin
FileName := '';
FileHash := '';
FileAttr := -1;
FileDate := 0;
FileSize := -1;
FileTextLineCount := -1;
end;
with RegData do begin
MainKey := '';
Path := '';
Key := '';
Value := '';
ValueHash := '';
end;
end;
end;