Autor |
Beitrag |
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Do 17.07.14 19:06
Hallo allerseits !
wenn ich eine Fehlermeldung beim Programm anzeige, kommt der Info-Ton beim selben Programm nur dann, wenn es mit XE2 kompiliert wird. Bei Delphi 6 PE aber nicht.
Was ist wohl der Grund ? Ich verwende Windows 7 Professional 32 bit.
Grüsse,
Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Fr 18.07.14 11:01
Möglicherweise habe ich mich unklar ausgedrückt: Ich meine die Fehleranzeige als Infobox im Programm. (s. Beilage)
Grüsse,
Hochhaus
Einloggen, um Attachments anzusehen!
|
|
jaenicke
Beiträge: 19284
Erhaltene Danke: 1742
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Fr 18.07.14 11:11
Ich vermute einmal es werden verschiedene API-Dialogboxen verwendet. Die angezeigte sieht neu aus (weißer Hintergrund im oberen Teil), die von Delphi 6 wird vermutlich anders aussehen, oder?
Im Stacktrace solltest du auch sehen können welche DialogBox verwendet wird.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Fr 18.07.14 14:15
Code:
Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7:
| If InvalidExtension(S) Then Begin MessageDlg('Fehler: Dateityp wird nicht unterstützt !', mtError, [mbOk], 0); Status := False; SaveAs := Status; Exit; End; |
Gleicher Code in Delphi 6 PE und XE2.
Hochhaus
|
|
WasWeißDennIch
Beiträge: 653
Erhaltene Danke: 160
|
Verfasst: Fr 18.07.14 14:23
Und wenn Du testhalber einmal (Application.)MessageBox statt MessageDlg benutzt?
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Fr 18.07.14 14:39
WasWeißDennIch hat folgendes geschrieben : | Und wenn Du testhalber einmal (Application.)MessageBox statt MessageDlg benutzt? |
Sorry. Ich finde auf die Schnelle die Syntax der MessageBox nicht. Ich werde die Hilfe nach Beispielen durchsuchen müssen.
Hochhaus
|
|
WasWeißDennIch
Beiträge: 653
Erhaltene Danke: 160
|
Verfasst: Fr 18.07.14 14:40
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Fr 18.07.14 14:54
Auch mit der MessageBox tritt dann der Ton unter Delphi 6 PE nicht auf.
|
|
WasWeißDennIch
Beiträge: 653
Erhaltene Danke: 160
|
Verfasst: Fr 18.07.14 15:05
Der Unterschied kann dann aber doch eigentlich nur darin liegen, dass unter 6 die Ansi- und unter XE2 die Unicode-Variante der MessageBox verwendet wird. Dass diese sich im Bezug auf den Signalton unterschiedlich verhalten bzw. konfigurieren lassen, wäre mir neu, aber unmöglich ist ja nichts.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
jaenicke
Beiträge: 19284
Erhaltene Danke: 1742
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Fr 18.07.14 15:16
Statt einfach einmal in den Stacktrace zu schauen wie ich gleich am Anfang geschrieben hatte um herauszufinden welche API-Funktion benutzt wird...
Dann sieht man nämlich, dass aktuelle Delphiversionen TaskDialogIndirect benutzen. Das gab es in Delphi 6 100%ig noch nicht, da es das in Windows noch gar nicht gab. Vor Vista nutzen aktuelle Delphiversionen laut Quelltext ein eigenes Formular. Bei Delphi 6 kannst du nur selbst schauen...
Einloggen, um Attachments anzusehen!
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Fr 18.07.14 16:58
Danke ! Damit wäre das Problem erklärt. Nur: Wie aufwändig ist es, das in Delphi 6 PE selbst zu flicken ? Ich erwarte als Antwort nur eine grobe Schätzung des Aufwandes. Möglicherweise werde ich nicht darum herumkommen, die alte Delphi-Version zu vergessen ...
|
|
jaenicke
Beiträge: 19284
Erhaltene Danke: 1742
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Fr 18.07.14 17:40
Du hast unter Delphi 6 ja noch ganz andere Probleme, angefangen bei der fehlerhaften Fensterrahmenberechnung (die dazu führt, dass du eine unter XP kompilierte Exe je nach Fensterdesign auch nur dort einsetzen kannst und eine unter Vista und höher kompilierte nur dort), über die Fehler in Kombination mit Themes (z.B. in Kombination mit einer Paintbox oder beim Drücken von Alt) bis hin zu Fehlern mit UINT64 usw., insofern ist das ohnehin sinnvoll...
Du kannst die API-Funktion manuell (aus der MSDN Doku oder einer Headerübersetzung) deklarieren und je nach Windowsversion dann diese oder die von Delphi aufrufen. Das ist schon einiger Aufwand. Oder du nimmst die Funktion Windows.MessageBox, damit sollte der Effekt ähnlich sein.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
WasWeißDennIch
Beiträge: 653
Erhaltene Danke: 160
|
Verfasst: Fr 18.07.14 18:17
Bei der MessageBox tritt aber dasselbe Phänomen auf, steht doch oben.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
jaenicke
Beiträge: 19284
Erhaltene Danke: 1742
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Fr 18.07.14 20:17
Das kann ich nicht nachvollziehen: Delphi-Quelltext 1: 2: 3:
| MessageBox(Handle, 'MessageBox', 'test', MB_OK or MB_ICONERROR); Application.MessageBox('Application.MessageBox', 'test', MB_OK or MB_ICONERROR); MessageDlg('MessageDlg', mtError, [mbOk], 0); |
Delphi 6, Programm ausgeführt unter Windows XP und Windows 8.1, Ergebnis bei beiden gleich:
Die beiden MessageBox Befehle bringen den Ton, der MessageDlg nicht.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Sa 19.07.14 07:51
Ok. Dann habe ich bei der Messagebox einen Fehler gemacht.
Hochhaus
|
|
jaenicke
Beiträge: 19284
Erhaltene Danke: 1742
W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Sa 19.07.14 08:22
Vielleicht hast du den falschen Typ im Test benutzt. Ein Fehlerton kommt natürlich nur bei Typ Fehler.
Für diesen Beitrag haben gedankt: Hochhaus
|
|
Hochhaus
Beiträge: 662
Erhaltene Danke: 8
Windows 7
Delphi XE2
|
Verfasst: Sa 19.07.14 13:01
jaenicke hat folgendes geschrieben : | Vielleicht hast du den falschen Typ im Test benutzt. Ein Fehlerton kommt natürlich nur bei Typ Fehler. |
So ist es. Damit wäre dieses Problem erledigt. Falls ich Delphi 6 PE weiterbenützen will, werde ich wohl noch haufenweise über Probleme stolpern. Fazit: Nur noch Delphi XE2 oder höher benützen.
Hochhaus
|
|