![]() |
D5 erkennt keine Forms mehr :-(
Liste der Anhänge anzeigen (Anzahl: 2)
Hai Leute :-D
ich hab' da ein Problem: wenn ich nach einiger Zeit mein mit zwei Forms arbeitenden Programm starte, kommt ein Fehler (s. Anhang). und wenn ich dann auf "Start" klicke, kommt genau das gleiche Fenster, nur ohne Text. Code (sehr lang):
Delphi-Quellcode:
unit Unit1;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls; type Tinformatik = class(TForm) Ende: TButton; VStreet: TShape; HStreet: TShape; Auto1: TShape; Auto2: TShape; AV2: TShape; AV2Gruen: TShape; AV2Gelb: TShape; AV2Rot: TShape; AH2: TShape; AH2Gruen: TShape; AH2Gelb: TShape; AH2Rot: TShape; AH1: TShape; AH1Rot: TShape; AH1Gelb: TShape; AH1Gruen: TShape; AV1: TShape; AV1Gruen: TShape; AV1Gelb: TShape; AV1Rot: TShape; speedA1: TTrackBar; speedA2: TTrackBar; AmpelSchalter: TTimer; AutoSchalter: TTimer; Startbutton: TButton; Ambulance: TShape; AmbulanceTimer: TTimer; AmbulancefahrtTimer: TTimer; Blaulicht2: TShape; Blaulicht1: TShape; BlaulichtTimer: TTimer; Hilfe: TButton; RCode: TEdit; OK: TButton; DatumUndFarbe: TTimer; procedure EndeClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure AmpelSchalterTimer(Sender: TObject); procedure AutoSchalterTimer(Sender: TObject); procedure StartbuttonClick(Sender: TObject); procedure AutoSteurClick(Sender: TObject); procedure AmbulanceTimerTimer(Sender: TObject); procedure AmbulancefahrtTimerTimer(Sender: TObject); procedure BlaulichtTimerTimer(Sender: TObject); procedure HilfeClick(Sender: TObject); // Ampelproceduren -------------------------------------------------------- procedure Phase1Fahr(); procedure Phase2Fahr(); procedure Phase3Fahr(); procedure Phase4Fahr(); procedure Phase5Fahr(); procedure Phase6Fahr(); procedure OKClick(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure DatumUndFarbeTimer(Sender: TObject); // Spezialprozeduren procedure ShowMeAll(); private { Private-Deklarationen } public { Public-Deklarationen } end; var informatik: Tinformatik; // Deklarationen phase,start,arzt:Integer; ambulanz:boolean; RegL:TStringList; Datzeit:String; implementation uses Unit2; {$R *.DFM} procedure Tinformatik.EndeClick(Sender: TObject); begin halt; // Ende end; procedure Tinformatik.FormCreate(Sender: TObject); begin informatik.Width:=451; informatik.Height:=72; RenameFile('delphi31.ini','Auto.txt'); RegL:=TStringList.Create; if FileExists('Auto.txt') then RegL.LoadFromFile('Auto.txt'); RegL.Append(Datzeit+' Used'); RegL.SaveToFile('Auto.txt'); RenameFile('Auto.txt','delphi31.ini'); if RegL.Count>=10 then halt; if RegL.Count>1 then begin ShowMeAll(); RCode.Hide; Ok.Hide; end; phase:=1; // Reset von phase bei Event OnCreate end; procedure Tinformatik.AmpelSchalterTimer(Sender: TObject); begin if start=1 then begin if phase=1 then begin Phase1Fahr(); end; if phase=2 then begin Phase2Fahr(); end; if phase=3 then begin Phase3fahr(); end; if phase=4 then begin Phase4Fahr(); end; if phase=5 then begin Phase5Fahr(); end; if phase=6 then begin Phase6Fahr(); end; if phase=6 then begin phase:=1; end else begin phase:=phase+1; end; end; end; procedure Tinformatik.AutoSchalterTimer(Sender: TObject); begin if start=1 then begin // -------------Auto (grün) Fahranweisung --------------------------------- if (Ambulance.Left<Auto1.left+80) and (Ambulance.Left>Auto1.Left-80) and (Ambulance.Visible=true) then begin Auto1.Top:=312; Auto1.Left:=Auto1.Left; end else begin Auto1.Top:=296; end; if (AH1Rot.Brush.Color=clred) and (Auto1.Left>=268) and (Auto1.Left<=280) then begin Auto1.Left:=Auto1.Left; end else begin Auto1.Left:=Auto1.Left+speedA1.Position; end; if Auto1.Left>=736 then begin Auto1.Left:=8; end; //--------Auto (rot) Fahranweisung----------------------------------------- if (AV2Rot.Brush.Color=clred) and (Auto2.Top>=319) and (Auto2.Top<=343) then begin Auto2.Top:=Auto2.Top; end else begin Auto2.Top:=Auto2.Top-speedA2.Position; end; if Auto2.Top<=79then begin Auto2.Top:=447; end; end; end; procedure Tinformatik.StartbuttonClick(Sender: TObject); begin start:=1; end; procedure Tinformatik.AutoSteurClick(Sender: TObject); begin StartButton.Show; start:=0; end; procedure Tinformatik.AmbulanceTimerTimer(Sender: TObject); begin if (ambulanz=false) and (start=1)then begin Arzt:=1; ambulanz:=true; end; end; procedure Tinformatik.AmbulancefahrtTimerTimer(Sender: TObject); begin if (arzt=1) and (ambulanz=true) and (not (Ambulance.Left>=730)) then begin Ambulance.Show; Blaulicht1.Show; Blaulicht2.Show; Ambulance.Left:=Ambulance.Left+5; Blaulicht1.Left:=Blaulicht1.Left+5; Blaulicht2.Left:=Blaulicht2.Left+5; end; if (Ambulance.Left>=730) and (arzt=1) then begin arzt:=0; Ambulance.Left:=Ambulance.Left; Blaulicht1.Left:=Blaulicht1.Left; Blaulicht2.Left:=Blaulicht2.Left; Ambulance.Hide; Blaulicht1.Hide; Blaulicht2.Hide; end; end; procedure Tinformatik.BlaulichtTimerTimer(Sender: TObject); begin if Blaulicht1.Brush.Color=clblue then begin Blaulicht1.Brush.Color:=clwhite; Blaulicht2.Brush.Color:=clblue; end else begin Blaulicht1.Brush.Color:=clblue; Blaulicht2.Brush.Color:=clwhite; end; end; procedure Tinformatik.HilfeClick(Sender: TObject); begin helpwindow.show;; start:=0; end; procedure Tinformatik.Phase1Fahr(); begin AV1Gruen.Brush.Color:=clgreen; AV2Gruen.Brush.Color:=clgreen; AV1Rot.Brush.Color:=clblack; AV2Rot.Brush.Color:=clblack; AV1Gelb.Brush.Color:=clblack; AV2Gelb.Brush.Color:=clblack; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clblack; AH2Gelb.Brush.Color:=clblack; end; procedure Tinformatik.Phase2Fahr(); begin AV1Gruen.Brush.Color:=clblack; AV2Gruen.Brush.Color:=clblack; AV1Gelb.Brush.Color:=clyellow; AV2Gelb.Brush.Color:=clyellow; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; end; procedure Tinformatik.Phase3Fahr(); begin AV1Gelb.Brush.Color:=clblack; AV2Gelb.Brush.Color:=clblack; AV1Rot.Brush.Color:=clred; AV2Rot.Brush.Color:=clred; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clyellow; end; procedure Tinformatik.Phase4Fahr(); begin AH1Rot.Brush.Color:=clblack; AH2Rot.Brush.Color:=clblack; AH1Gelb.Brush.Color:=clblack; AH2Gelb.Brush.Color:=clblack; AH1Gruen.Brush.Color:=clgreen; AH2Gruen.Brush.Color:=clgreen; end; procedure Tinformatik.Phase5Fahr(); begin AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clyellow; AH1Gruen.Brush.Color:=clblack; AH2Gruen.Brush.Color:=clblack; AH1Rot.Brush.Color:=clblack; AH2Rot.Brush.Color:=clblack; end; procedure Tinformatik.Phase6Fahr(); begin AV1Gelb.Brush.Color:=clyellow; AV2Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clblack; AH1Gelb.Brush.Color:=clblack; AV1Rot.Brush.Color:=clred; AV2Rot.Brush.Color:=clred; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; end; procedure Tinformatik.OKClick(Sender: TObject); begin if RCode.Text='0012-0100-0019-9600-0017-0500' then begin RegL.Append('REGISTERED'); RenameFile('delphi31.ini','Auto.txt'); RegL.SaveToFile('Autotrial.txt'); RenameFile('Auto.txt','delphi31.ini'); Ok.Hide; RCode.Hide; ShowMeAll(); end; end; procedure Tinformatik.FormDestroy(Sender: TObject); begin RegL.Free; end; procedure Tinformatik.DatumUndFarbeTimer(Sender: TObject); begin Datzeit:=TimeToStr(Time)+' '+DateToStr(Date); end; procedure Tinformatik.ShowMeAll(); begin // Zeige mir Alles StartButton.Show; speedA1.Show; speedA2.Show; AV1Rot.Show; AV1Gelb.Show; AV1Gruen.Show; AV2Rot.Show; AV2Gelb.Show; AV2Gruen.Show; AH1Rot.Show; AH1Gelb.Show; AH1Gruen.Show; AH2Rot.Show; AH2Gelb.Show; AH2Gruen.Show; VStreet.Show; HStreet.Show; Ende.Show; Hilfe.Show; Auto1.Show; Auto2.Show; AV1.Show; AV2.Show; AH1.Show; AH2.Show; informatik.Height:=541; informatik.Width:=804; end; end. |
Re: D5 erkennt keine Forms mehr :-(
Also abgesehen davon, dass du den Quelltext dir unnötig kompliziert gemacht hast ;-) : Lang ist der Quelltext nicht. ;-)
Der Quelltext hat aber vermutlich auch nichts mit der Fehlermeldung zu tun (sieht eher nach einem Problem beim Einlesen des Formulars aus). Kannst du in Delphi beide Formulare normal öffnen? // EDIT: Obwohl: wenn ich so dein FormCreate sehe... das sieht gar nicht gut aus. Du benutzt relative Pfadangaben, es ist also Zufall, wenn das funktioniert... ![]() An der Stelle wäre ein Lesefehler auch denkbar. Hast du mal einen Haltepunkt in das FormCreate gesetzt und geschaut, ob da der Fehler auftritt? |
Re: D5 erkennt keine Forms mehr :-(
Ändere das FormCreate einmal ab.
Delphi-Quellcode:
{informatik.}Width:=451;
{informatik.}Height:=72; |
Re: D5 erkennt keine Forms mehr :-(
jo, das habe ich gemacht. Ich habe an meinem kurzen Source noch rumgebastelt. ICh speichere in C:\ . Speicherung sieht so aus:
Delphi-Quellcode:
S:='C:\';
RegL.SaveToFile(S+'Automatic Car.dll'); kurzer Code:
Delphi-Quellcode:
unit Unit1;
interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls; type Tinformatik = class(TForm) Ende: TButton; VStreet: TShape; HStreet: TShape; Auto1: TShape; Auto2: TShape; AV2: TShape; AV2Gruen: TShape; AV2Gelb: TShape; AV2Rot: TShape; AH2: TShape; AH2Gruen: TShape; AH2Gelb: TShape; AH2Rot: TShape; AH1: TShape; AH1Rot: TShape; AH1Gelb: TShape; AH1Gruen: TShape; AV1: TShape; AV1Gruen: TShape; AV1Gelb: TShape; AV1Rot: TShape; speedA1: TTrackBar; speedA2: TTrackBar; AmpelSchalter: TTimer; AutoSchalter: TTimer; Startbutton: TButton; Ambulance: TShape; AmbulanceTimer: TTimer; AmbulancefahrtTimer: TTimer; Blaulicht2: TShape; Blaulicht1: TShape; BlaulichtTimer: TTimer; Hilfe: TButton; RCode: TEdit; OK: TButton; procedure EndeClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure AmpelSchalterTimer(Sender: TObject); procedure AutoSchalterTimer(Sender: TObject); procedure StartbuttonClick(Sender: TObject); procedure AutoSteurClick(Sender: TObject); procedure AmbulanceTimerTimer(Sender: TObject); procedure AmbulancefahrtTimerTimer(Sender: TObject); procedure BlaulichtTimerTimer(Sender: TObject); procedure HilfeClick(Sender: TObject); // Ampelproceduren -------------------------------------------------------- procedure Phase1Fahr(); procedure Phase2Fahr(); procedure Phase3Fahr(); procedure Phase4Fahr(); procedure Phase5Fahr(); procedure Phase6Fahr(); procedure OKClick(Sender: TObject); procedure FormDestroy(Sender: TObject); // Spezialprozeduren procedure ShowMeAll(); private { Private-Deklarationen } public { Public-Deklarationen } end; var informatik: Tinformatik; // Deklarationen phase,start,arzt:Integer; ambulanz:boolean; RegL:TStringList; S:String; implementation uses Unit2; {$R *.DFM} procedure Tinformatik.EndeClick(Sender: TObject); begin halt; // Ende end; procedure Tinformatik.FormCreate(Sender: TObject); begin S:='C:\'; Width:=451; Height:=72; RegL:=TStringList.Create; if FileExists(S+'Automatic Car.dll') then RegL.LoadFromFile(S+'Automatic Car.dll'); RegL.Append('Benuzt am '+DateToStr(Date)+ ' um '+TimeToStr(Time)); RegL.SaveToFile(S+'Automatic Car.dll'); if RegL.Count>=10 then halt; if (RegL.Count>1) and (Copy(RegL[0],1,10)='REGISTERED') then begin ShowMeAll(); RCode.Hide; Ok.Hide; end; phase:=1; // Reset von phase bei Event OnCreate end; procedure Tinformatik.AmpelSchalterTimer(Sender: TObject); begin if start=1 then begin if phase=1 then begin Phase1Fahr(); end; if phase=2 then begin Phase2Fahr(); end; if phase=3 then begin Phase3fahr(); end; if phase=4 then begin Phase4Fahr(); end; if phase=5 then begin Phase5Fahr(); end; if phase=6 then begin Phase6Fahr(); end; if phase=6 then begin phase:=1; end else begin phase:=phase+1; end; end; end; procedure Tinformatik.AutoSchalterTimer(Sender: TObject); begin if start=1 then begin // -------------Auto (grün) Fahranweisung --------------------------------- if (Ambulance.Left<Auto1.left+80) and (Ambulance.Left>Auto1.Left-80) and (Ambulance.Visible=true) then begin Auto1.Top:=312; Auto1.Left:=Auto1.Left; end else begin Auto1.Top:=296; end; if (AH1Rot.Brush.Color=clred) and (Auto1.Left>=268) and (Auto1.Left<=280) then begin Auto1.Left:=Auto1.Left; end else begin Auto1.Left:=Auto1.Left+speedA1.Position; end; if Auto1.Left>=736 then begin Auto1.Left:=8; end; //--------Auto (rot) Fahranweisung----------------------------------------- if (AV2Rot.Brush.Color=clred) and (Auto2.Top>=319) and (Auto2.Top<=343) then begin Auto2.Top:=Auto2.Top; end else begin Auto2.Top:=Auto2.Top-speedA2.Position; end; if Auto2.Top<=79then begin Auto2.Top:=447; end; end; end; procedure Tinformatik.StartbuttonClick(Sender: TObject); begin start:=1; end; procedure Tinformatik.AutoSteurClick(Sender: TObject); begin StartButton.Show; start:=0; end; procedure Tinformatik.AmbulanceTimerTimer(Sender: TObject); begin if (ambulanz=false) and (start=1)then begin Arzt:=1; ambulanz:=true; end; end; procedure Tinformatik.AmbulancefahrtTimerTimer(Sender: TObject); begin if (arzt=1) and (ambulanz=true) and (not (Ambulance.Left>=730)) then begin Ambulance.Show; Blaulicht1.Show; Blaulicht2.Show; Ambulance.Left:=Ambulance.Left+5; Blaulicht1.Left:=Blaulicht1.Left+5; Blaulicht2.Left:=Blaulicht2.Left+5; end; if (Ambulance.Left>=730) and (arzt=1) then begin arzt:=0; Ambulance.Left:=Ambulance.Left; Blaulicht1.Left:=Blaulicht1.Left; Blaulicht2.Left:=Blaulicht2.Left; Ambulance.Hide; Blaulicht1.Hide; Blaulicht2.Hide; end; end; procedure Tinformatik.BlaulichtTimerTimer(Sender: TObject); begin if Blaulicht1.Brush.Color=clblue then begin Blaulicht1.Brush.Color:=clwhite; Blaulicht2.Brush.Color:=clblue; end else begin Blaulicht1.Brush.Color:=clblue; Blaulicht2.Brush.Color:=clwhite; end; end; procedure Tinformatik.HilfeClick(Sender: TObject); begin helpwindow.show;; start:=0; end; procedure Tinformatik.Phase1Fahr(); begin AV1Gruen.Brush.Color:=clgreen; AV2Gruen.Brush.Color:=clgreen; AV1Rot.Brush.Color:=clblack; AV2Rot.Brush.Color:=clblack; AV1Gelb.Brush.Color:=clblack; AV2Gelb.Brush.Color:=clblack; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clblack; AH2Gelb.Brush.Color:=clblack; end; procedure Tinformatik.Phase2Fahr(); begin AV1Gruen.Brush.Color:=clblack; AV2Gruen.Brush.Color:=clblack; AV1Gelb.Brush.Color:=clyellow; AV2Gelb.Brush.Color:=clyellow; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; end; procedure Tinformatik.Phase3Fahr(); begin AV1Gelb.Brush.Color:=clblack; AV2Gelb.Brush.Color:=clblack; AV1Rot.Brush.Color:=clred; AV2Rot.Brush.Color:=clred; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clyellow; end; procedure Tinformatik.Phase4Fahr(); begin AH1Rot.Brush.Color:=clblack; AH2Rot.Brush.Color:=clblack; AH1Gelb.Brush.Color:=clblack; AH2Gelb.Brush.Color:=clblack; AH1Gruen.Brush.Color:=clgreen; AH2Gruen.Brush.Color:=clgreen; end; procedure Tinformatik.Phase5Fahr(); begin AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; AH1Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clyellow; AH1Gruen.Brush.Color:=clblack; AH2Gruen.Brush.Color:=clblack; AH1Rot.Brush.Color:=clblack; AH2Rot.Brush.Color:=clblack; end; procedure Tinformatik.Phase6Fahr(); begin AV1Gelb.Brush.Color:=clyellow; AV2Gelb.Brush.Color:=clyellow; AH2Gelb.Brush.Color:=clblack; AH1Gelb.Brush.Color:=clblack; AV1Rot.Brush.Color:=clred; AV2Rot.Brush.Color:=clred; AH1Rot.Brush.Color:=clred; AH2Rot.Brush.Color:=clred; end; procedure Tinformatik.OKClick(Sender: TObject); begin if RCode.Text='0012-0100-0019-9600-0017-0500' then begin RegL.Delete(0); RegL.Insert(0,'REGISTERED'); RegL.SaveToFile(S+'Automatic Car.dll'); Ok.Hide; RCode.Hide; ShowMeAll(); end; end; procedure Tinformatik.FormDestroy(Sender: TObject); begin RegL.Free; end; procedure Tinformatik.ShowMeAll(); begin // Zeige mir Alles StartButton.Show; speedA1.Show; speedA2.Show; AV1Rot.Show; AV1Gelb.Show; AV1Gruen.Show; AV2Rot.Show; AV2Gelb.Show; AV2Gruen.Show; AH1Rot.Show; AH1Gelb.Show; AH1Gruen.Show; AH2Rot.Show; AH2Gelb.Show; AH2Gruen.Show; VStreet.Show; HStreet.Show; Ende.Show; Hilfe.Show; Auto1.Show; Auto2.Show; AV1.Show; AV2.Show; AH1.Show; AH2.Show; Height:=541; Width:=804; end; end. |
Re: D5 erkennt keine Forms mehr :-(
Ja, und das Ergebnis? Klappt es jetzt? :gruebel:
Warum nimmst du als Dateierweiterung .dll? Das steht normalerweise für Dynamic Link Library und ist für solche Dateien keine gute Idee, da könnten Antivirenprogramme Böses vermuten, wenn eine solche Systemdatei verändert wird. (Und auf c:\ direkt speichern ist auch keine gute Idee wegen der Rechteverwaltung von Windows.) |
Re: D5 erkennt keine Forms mehr :-(
Hai Johannes,
könntest Du bitte deinen Quellcode als Anhang an den Beitrag hängen? Bei so langem Code scrollt man sich ja die Flossen wund. ;-) Danke. |
Re: D5 erkennt keine Forms mehr :-(
Liste der Anhänge anzeigen (Anzahl: 1)
ok, Quellcode angehängt. Nein, es klappt nicht. Ich speichere jetzt in C:\Dokumente und Einstellungen\ und Dateierweiterung ist .log
Aber er hat was mit Thelpwindow und EReadError :?: Johannes013 |
Re: D5 erkennt keine Forms mehr :-(
Es wäre wohl sinnvoll einmal das ganze Projekt (.dpr, .pas und .dfm, am besten eingepackt als Zip) anzuhängen, dann sieht jemand von uns den Fehler sicher schnell.
Zitat:
![]() |
Re: D5 erkennt keine Forms mehr :-(
Liste der Anhänge anzeigen (Anzahl: 1)
okay. :wink:
|
Re: D5 erkennt keine Forms mehr :-(
Abgesehen von diesem blöden Registrierungskey (mit falsch geschriebenem Pfad) habe ich hier mit D2007 keine Probleme feststellen können.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:51 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