Autor Beitrag
Hochhaus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: 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 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: 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 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Fr 18.07.14 14:15 
Code:

ausblenden 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Fr 18.07.14 14:23 
Und wenn Du testhalber einmal (Application.)MessageBox statt MessageDlg benutzt?

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Fr 18.07.14 14:39 
user profile iconWasWeißDennIch hat folgendes geschrieben Zum zitierten Posting springen:
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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: Fr 18.07.14 14:40 

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Fr 18.07.14 14:54 
Auch mit der MessageBox tritt dann der Ton unter Delphi 6 PE nicht auf.
WasWeißDennIch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: 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... :roll:

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...

MessageDlg
Einloggen, um Attachments anzusehen!

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 653
Erhaltene Danke: 160



BeitragVerfasst: 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
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 18.07.14 20:17 
Das kann ich nicht nachvollziehen:
ausblenden 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. :nixweiss:

Für diesen Beitrag haben gedankt: Hochhaus
Hochhaus Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Sa 19.07.14 07:51 
Ok. Dann habe ich bei der Messagebox einen Fehler gemacht.

Hochhaus
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19272
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: 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 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 662
Erhaltene Danke: 8

Windows 7
Delphi XE2
BeitragVerfasst: Sa 19.07.14 13:01 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
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