Autor Beitrag
MarioL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win XP, Win 7
Delphi 6
BeitragVerfasst: Sa 17.04.10 21:23 
Hallo, wie kann ich eine Datei in ein laufendes Programm laden?

Bei doppelklick auf meine Datei starte ich mein Programm und lese die Datei mit folgenden code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormCreate(Sender: TObject);
begin
  If (ParamCount>0and (FileExists(ParamStr(1))) then begin
    sFilePath := ExtractFilePath(ParamStr(1));
    sFileName:= ExtractFileName(ParamStr(1));
    //... (Datei verarbeiten)
  end;
  //...
end;


eine zweite Instanz des Programms habe ich verhindert.

Wie kann ich jetzt bei doppelklick auf die nächste Datei diese in mein Programm einlesen ???

(habe zwar ein älteres Thema dazu gefunden, bin aber daraus leider nicht schlau geworden)

MfG Mario

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8549
Erhaltene Danke: 478

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 17.04.10 21:47 
Schau dir mal die Unit OneInst von Luckies Seite an. Damit geht das sehr einfach. :D

_________________
We are, we were and will not be.
MarioL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win XP, Win 7
Delphi 6
BeitragVerfasst: Sa 17.04.10 22:09 
Danke für die schnelle Antwort, das ist genau das was ich suchte.

MfG Mario