Autor Beitrag
Nemesis II
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:07 
Hallo Leute,

warum bekomme ich bei einem OpenTextFileDialog eine Fehlermeldung wenn ich keine Text-Datei ausgewählt hab, und das Fenster einfach nur schließe, also auf "Abbrechen" drücke. Auch das selbe passiert beim SaveTextFileDialog.

Die Fehlermeldung beim OpenDialog: Cannot open file "". Das System kann den angegebenen Pfad nicht finden.

Die Fehlermeldung beim SaveDialog: Cannot create file "". Das System kann den angegebenen Pfad nicht finden.

MfG Eugen
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 19.02.06 20:21 
Hallo

wie sieht denn dein code aus?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if opendialog.execute then
  begin
    machwasmit(opendialog.filename)
  end;

... das execute ist wichtig

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:24 
Hallo also das ist mein Code zum öffnen einer Text-Datei:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.SpeedButton2Click(Sender: TObject);

begin
OpenTextFileDialog1.Execute;
Memo1.Lines.LoadFromFile(OpenTextFileDialog1.FileName);
end;


Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 19.02.06 20:31 
hallo,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
begin
 if NOT Opendialog1.Execute then
 exit;
 Memo1.Lines.LoadFromFile(OpenTextFileDialog1.FileName); 
end;


nun dürfte keine fehlermeldung mehr kommen :roll:
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:40 
Danke

also die Fehlermeldung ist weg, aber beim schließen des Fensters erscheint es nochmal und erst beim zweiten mal schließen verschwindet es.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 19.02.06 20:42 
zeig mal deinen quellcode, denn bei mir klappt es wunderbar ;)
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:43 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.SpeedButton2Click(Sender: TObject);

begin
OpenTextFileDialog1.Execute;
if NOT OpenTextFileDialog1.Execute then exit;
Memo1.Lines.LoadFromFile(OpenTextFileDialog1.FileName);
end;


Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 19.02.06 20:44 
du öffnest ja auch 2x den Opendialog :lol:
lass mal "OpenTextFileDialog1.Execute;" weg ;)

edit Setz doch mal Delphi-Tags!!


Zuletzt bearbeitet von Marc. am So 19.02.06 20:46, insgesamt 2-mal bearbeitet
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:45 
ok hab den Fehler :oops:
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 19.02.06 20:47 
aber setz doch bitte beim nächsten mal die delphi-tags...

[ delphi] code [ /delphi] ;)
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 20:56 
meinst du das hier?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if (ssLeft in Shift) then
  begin
    ReleaseCapture;
    SendMessage(Self.Handle, WM_SYSCOMMAND, SC_MOVE + 10);
  end;
end;
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 19.02.06 20:58 
genau :P
dann haben die mod's wenigstens ein bissle weniger arbeit hier im forum zu bewältigen :)
außerdem wird dein quelltext dadurch deutlich leserlicher ;)
Nemesis II Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 49



BeitragVerfasst: So 19.02.06 21:00 
ok mach ich beim nächsten mal

danke nochmals für die schnellen Antworten!

MfG Eugen