![]() |
Diese Anwendung wird aufgrund eines ungültigen Vorgangs ...
Mein Programm läuft unter Windows NT, 2000, XP und 2003 ohne Fehler, aber unter Win98 (VMWare) bekomme ich an unterschiedlichen Stellen (mal läufts, mal crashts) die folgende Meldung:
Zitat:
Ich habe on Create meines Form die WndProc meiner ProgressBar überschrieben:
Delphi-Quellcode:
Wenn ich die WndProc nicht überschreibe, dann läuft das Programm ohne Probleme. Was kann bei dieser Funktion unter Win9x einen kompletten Systemabsturz verursachen :roll: :gruebel:
OldProgressWndProc := ProgressBar1.WindowProc;
ProgressBar1.WindowProc := ProgressWndProc; ... procedure TMyProg.ProgressWndProc(var Msg: TMessage); var dc: HDC; rect: TRect; myfont: Cardinal; Text: string; begin OldProgressWndProc(Msg); if ((Msg.Msg = 1026) or (Msg.Msg = WM_PAINT)) and (Timer3.Enabled = False) then // Wenn die Progressbar neugezeichnet wurde, // und somit die Zahl weg ist: Prozentzahl neu draufpinseln begin if (ProgressBar1.Max = 0) or (ProgressBar1.Position = 0) then Text := '0%' else if ProgressBar1.Max = ProgressBar1.Position then Text := '100%' else Text := IntToStr(Trunc(100 / ProgressBar1.Max * ProgressBar1.Position)) + '%'; dc := GetWindowDC(Progressbar1.Handle); try rect := ProgressBar1.ClientRect; //InvalidateRect(Progressbar1.Handle, @rect, True); myfont := CreateFont(MyProg_Main.Font.Size {-11}, 0, 0, 0, 0, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, PAnsiChar(MyProg_Main.Font.Name) {'Verdana'}); if suiSkinEngine1.Active = True then SetBkMode(dc, TRANSPARENT); SetTextColor(dc, clBlack); SelectObject(dc, myfont); DrawText(dc, PChar(Text), length(Text), rect, DT_SINGLELINE or DT_VCENTER or DT_CENTER); finally DeleteObject(myfont); ReleaseDC(Progressbar1.Handle, dc); end; end; end; |
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Such mal hier im Forum nach madschis madCollection und bau die ein. dann bekommst du eine wesentlich aussagekräftigere Fehlermeldung.
da fällt mir noch ein: Anstatt
Delphi-Quellcode:
eventuell mal die ursprüngliche mit
OldProgressWndProc(Msg);
Delphi-Quellcode:
aufrufen.
inherited(..);
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Möglicherweise liegt das am Aufruf der OldWndProc.
Versuche es mal so:
Delphi-Quellcode:
NewProgressProc := CallWindowProc(OldProgressProc...
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Zitat:
Zitat:
Der Vorschlag mit madExcept ist gut, da siehst du genau, wo der Fehler auftritt. [Nachtrag] Was mir jetzt spontan auffällt ist, dass du nur ein SelectObject machst.
Delphi-Quellcode:
Normalerweise macht man so etwas wieder rückgängig:
SelectObject(dc, myfont);
Delphi-Quellcode:
Außerdem: warum erzeugst du den Font selbst und holst ihn dir nicht einfach von deinem Hauptformular?
oldfont := SelectObject(dc, myfont);
DrawText(...); SelectObject(dc, oldfont);
Delphi-Quellcode:
(dann aber natürlich das DeleteObject weglassen).
myfont := MyProg_Main.Font.Handle
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Zitat:
Lt. Hilfe müste nun in derIDE irgendwo im Projektmenü (?) ein Eintrag sein, ist er aber nicht, auch unter Start->Programme ist nichts :gruebel: |
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Was hast du installiert, alles oder nur die Basics ?
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Die Basics inkl. Madexcept...
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Installier mal alles, notfalls ist da ja noch das uninstall... das sollte dann passen :wink:
ich kann dir nicht genau sagen welche(s) tool du instalieren musst damit es sich in das Menue instalieret // edit Instalieren must du: madBasics madDisAsm madExcept ...dann bekommst du einen neuen Paletteneintrag [madshi] MadExceptionHandler und unter Menue -> Projekte -> madExcept Settings... |
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
Zitat:
|
Re: Diese Anwendung wird aufgrund eines ungültigen Vorgangs
:gruebel: dann installier doch mal alles...
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:07 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz