Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   FreePascal (https://www.delphipraxis.net/74-freepascal/)
-   -   TForm schließt plötzlich automatisch und beendet Prog (https://www.delphipraxis.net/202557-tform-schliesst-ploetzlich-automatisch-und-beendet-prog.html)

ManniSt 17. Nov 2019 11:01

TForm schließt plötzlich automatisch und beendet Prog
 
Seit gestern schließt mein Hauptformular automatisch, nachdem es kurz aufgeblinkt hat. Ich bin mir keiner Änderung daran bewußt.
Wer kann mir helfen???

Hauptprog

program WinFib;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset

Forms, u_winfib_main, u_menu, u_journueber, u_firma, u_speichern, u_reorg,
u_journal, u_neuindiz, u_saldendebitoren, u_saldenkreditoren, u_buchen,
u_saldensachkonten, u_debikontoblatt, datetimectrls, u_winfib_common,
u_Kredkontoblatt, u_sachkontoblatt, u_verzdebi, u_verzkredi, u_frage_satz_loeschen,
u_verzsach;


{$R *.res}
// {$R winfib.rc}

begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
// Diese Form wird nach dem Aufruf wieder geschlossen und das Prog wird automatisch beendet
Application.CreateForm(TF_Start, F_Start);

Application.CreateForm(TF_Menu, F_Menu);
//*** Die nachflogenden Formulare werden während der Laufzeit erzeugt
// Application.CreateForm(TF_Speichern, F_Speichern);
// Application.CreateForm(TF_Firma, F_Firma);
// Application.CreateForm(TF_JournUeber, F_JournUeber);
// Application.CreateForm(TF_Steuersaetze, F_Steuersaetze);
// Application.CreateForm(TF_Reorg, F_Reorg);
// Application.CreateForm(TF_Journal, F_Journal);
// Application.CreateForm(TF_NeuIndiz, F_NeuIndiz);
// Application.CreateForm(TF_SaldenDebitoren, F_SaldenDebitoren);
// Application.CreateForm(TF_SaldenKreditoren, F_SaldenKreditoren);
// Application.CreateForm(TF_SaldenSachkonten, F_SaldenSachkonten);
// Application.CreateForm(TF_DebiKontoblatt, F_DebiKontoblatt);
// Application.CreateForm(TF_Buchen, F_Buchen);
// Application.CreateForm(TF_KredKontoBlatt, F_KredKontBlatt);
// Application.CreateForm(TF_SachKontoBlatt, F_SachKontoBlatt);
// Application.CreateForm(TF_VerzDebi, F_VerzDebi);
// Application.CreateForm(TF_FrageSatzLoeschen, F_FrageSatzLoeschen);
// Application.CreateForm(TF_VerzKredi, F_VerzDebi);
// Application.CreateForm(TF_VerzSach, F_VerzDebi); Application.Run;
end.
-------------------------------------------------
Hauptform

unit u_winfib_main;

{$mode objfpc}{$H+}

interface

uses
Crt, Classes, SysUtils, Forms, Controls, Graphics,Dialogs,StdCtrls, DateUtils,
u_winfib_common, fileutil, DateTimePicker, u_menu, db, dbf;

type
{ TF_Start }

TF_Start = class(TForm)
Btn_WinFibStart: TButton;
Dsc_WinFibInit: TDataSource;
WinFibInit: TDbf;
DTP_BuchDat: TDateTimePicker;
Dsc_FibuConf: TDataSource;
Lbl_BuchDat: TLabel;
Lbl_Author: TLabel;
Lbl_Version: TLabel;
Lbl_Titel : TLabel;
procedure Btn_WinFibStartClick(Sender: TObject);
procedure DTP_BuchDatChange(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormResize(Sender: TObject);

end;

var
F_Start : TF_Start;
TextHilf : string; // Texthilfsvariable
MEnde : boolean; // Ende oder nicht

implementation

{$R *.lfm}

{ TF_Start }

//***********************************
//* Form Aktiviert
//*

procedure TF_Start.FormActivate(Sender: TObject);

var
MEnde : boolean = false;

begin
WinFibIni; // Ini-Variable lesen aus u_winfib_common

// BlaBlaBlub... Hier steht einiger Code, der bisher gut funktioniert hat

// Bei showmessage wird die Form, auch mit dem Start-Button korrekt dargestellt

showmessage('Halt');

// Nach dem Ende von showmessage springt das Prog aber direkt zum begin dieser procedure zurück, anschließend auf end
// und dann landet alles in
// customform.inc-> procedure TCustomForm.Activate->procedure TCustomForm.CMActivate->
// Assembler->procedure TCustomForm.CMActivate
// und das Prog endet

end; // procedure TF_Start.FormActivate

//*******************

end.

ManniSt 17. Nov 2019 11:53

AW: TForm schließt plötzlich automatisch und beendet Prog
 
Application.Run war die Ursache!!!!!!

Diese Zeile war in letzte Kommentarzeile des Hauptprog gerutscht. :( :roll:

Ich brauche wohl doch eine neue Brille ...

jaenicke 17. Nov 2019 12:12

AW: TForm schließt plötzlich automatisch und beendet Prog
 
Zitat:

Zitat von ManniSt (Beitrag 1451440)
Ich brauche wohl doch eine neue Brille ...

Eher eine bessere Versionsverwaltung wie SVN oder Git, falls du keine benutzt. Damit hättest du den Unterschied schneller gesehen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:10 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz