Autor Beitrag
motion
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Fr 10.11.06 20:42 
Hallo Leute,
ich suche geraden einen mysteriösen Fehler in meinem Warenwirtschaftssystem.
Gibt es eine Möglichkeit, einen Breakpoint AUF EINE GESAMT UNIT zu legen?
In einem kleinen Testprojekt habe ich überprüft, das diverse checkboxen und Groupboxen fehlerhaft (falsche Farben etc.) dargestellt werden, sobald ich meine Unit XXX einbinde.
Kommentiere ich die aus, ist alles klar.
Unit XXX hat KEINEN Intialization abschnitt.
Vielleicht wird da irgend eine Route von einer dritten Unit aufgerufen.
Kann ich einen Breakpoint auf die gesamte Unit XXX legen, so daß ich JEDEN Einsprung in die Unit im Debugger untersuchen kann?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 10.11.06 21:07 
Zitat:
Kann ich einen Breakpoint auf die gesamte Unit XXX legen, so daß ich JEDEN Einsprung in die Unit im Debugger untersuchen kann?
Nein, du könntest aber die Breakpoint schon früher setzen.

_________________
Markus Kinzler.
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Fr 10.11.06 22:38 
Tja, aber wo?
Der Fehler tritt nur auf, wenn ich im Testprojekt
"uses xxx" hinzufüge.
Kommentiere ich die Bibliothek aus, ist alles fehlerfrei.
Das Unit xxx keinen initialisierungsteil hat, und ich in meinem Projekt auf KEINE Prozedur bzw. kein Object oder Klasse aus unit xxx verwende, kann das nur über indirekte Beziehungen geschehen.

Hier mein Testprojekt (nur ein Formular UNIT1):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,
  xxx,  //diese Unit auskommentieren und der Fehler ist wech ...
 StdCtrls, ExtCtrls;
type
  TForm1 = class(TForm)
    GroupBox1: TPanel;
    CheckBox2: TCheckBox;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
end.


Und hier die Ansichten des Formulares in der IDE/DesignEditor (okay=checkbox hat rote Caption):
user defined image

und so soll es aussehen (ohne die Unit xxx; die checkbox Caption ist schön rot):
user defined image

wenn ich aber die Unit XXX einbinde, gibt's plötzlich in der Checkbox keine Farbe mehr.
user defined image
Selbst wenn ich dann per checkbox2.font.color:=clred; versuche das zur Laufzeit zu setzen, bleibt die Anzeige weiterhin schwarz.

In meiner Warenwirtschaft ist die ganze Darstellung noch schwieriger (plötzlich geänderte Rahmenecken (rund statt eckig), blaue Titel etc.). Eventuell greift da irgendein XP Manifest? Obiges Beispiel ist wirklich so simpelst wir möglich aufgelöst.
Aber jetzt müßte ich schon wissen, ob überhaupt ein Einsprung in die unit xxx stattfindet.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 10.11.06 22:53 
Das liegt meiner Meinung nach am Manifest

AXMD
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Fr 10.11.06 22:57 
Wie kann ich feststellen, welches Manifest aktiv ist (da bin ich nicht allzufit drin)?
Kann ich in der MAP Datei irgend etwas diesbezüglich finden?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 10.11.06 23:01 
Eventuell bindet deine Unit ein XP-Manifest ein; soweit ich weiß, sind Checkboxes immer schwarz vom Text her, sofern Luna verwendet wird. Du kannst ja aus der uses deiner Unit das Manifest entfernen.

AXMD
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Fr 10.11.06 23:41 
Korrekt, es ist das Manifest.
Hab' es mal verifiziert, in dem ich unit xxx ausgeklammert habe und dann ein TXPManifest auf das Form gelegt habe -> hat den gleichen Effekt.
Damit habe ich einen guten Ansatz um die Unit xxx oder deren abhängige Units daraufhin zu untersuchen.
Problem so gut wie gelöst!

Vielen Dank
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Fr 10.11.06 23:46 
Wenn du das Manifest in einer Unit einbindest, wird es auf alle anderen Forms in deinem Projekt angewandt (IIRC)

AXMD
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Sa 11.11.06 00:17 
Ich habe gerade alle TXPManifest gesucht und aus allen Forms gelöscht; außerdem dann alle Uses XPMAN rausgeschmissen.
Das ist jetzt sauber, aber das Problem besteht immer noch.
Wie kann ich jetzt noch feststellen, was für Referenzen auf Manifest existieren?
Die MAP Datei habe ich eben noch mal durchsucht nach XPMAN, XPManifest, manifest und da ist nichts mehr drin.
Hmmm... wo mag da noch was drin vergraben sein.
Vielleicht in den 3rd Party Componenten (TMS, RichView, IBO)?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 11.11.06 00:24 
Du kannst die fertige EXE mit einem Ressourcen-Editor untersuchen, um nachzusehen, ob das Manifest noch drin ist.

AXMD
motion Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 295

XP, Linux
D7 Prof
BeitragVerfasst: Mo 13.11.06 21:07 
Jo,
jetzt habe ich alle Verweise gefunden.
Auf einem Formular gab es noch einen Verweis auf "TWinXp" (eines TMS Komponente, welche die gleiche Funktion wie Delphi's TXPManifest hat).
Jetzt sind alle Manifest-Verweise raus und die Farben der Checkboxen stimmen wie gewünscht.