Laufende Prozesse anzeigen



  • Hallo,
    ich hatte gestern schon nach den Spash-Screens gefragt und eine schnelle tolle Antwort erhalten.
    Nun habe ich eine neue Frage die nicht unbedingt nur etwas mit dem Programmstart zu tun hat.
    Ich möchte mir den derzeitigen Stand der Anwendung anzeigen lassen, beim Start wäre dies, was gerade abgearbeitet wurde und im laufenden Betrieb, wie der Status des Programms ist. Lässt sich soetwas filtern und herausfinden?
    Das Besipiel zu den Spash-Screens hatte dieverse ansätze mit dabei, die aber nicht funktionierten.
    Bitte um Hilfe.



  • Hallo

    Natürlich geht das, du must es nur selber programmieren. Dafür gibt es jedenfalls keine Standardkomponenten.
    Der anfang wäre erstmal dein Programm intern in verschiedene logische Abschnitte aufzuteilen und zu benennen. Diese Bezeichnungen gibst du dann auf eine Statusanzeige (TLabel) aus wenn der Abschnitt erreicht ist.

    bis bald
    akari



  • Danke dir,
    ich mache mir malGedanken darüber. Werde bestimmt etwas Programmieren. Stelle es dann in das Forum.



  • Den Ladefortschritt des Progs kannst du auch so anzeigen:

    Plaziere eine ProgressBar (Position auf 0) und ein Label im Splash-Form.
    Dann sichere erstmal die Projekt-cpp 😉 zB project.old

    Probiere das mal aus :

    #include <vcl.h>
    #include "main.h"
    
    #include "splash.h"
    
    #pragma hdrstop
    USEFORM("splash.cpp", FormSplash);
    USEFORM("frm1.cpp", Form1);
    USEFORM("frm2.cpp", Form2);
    USEFORM("frm3.cpp", Form3);
    USEFORM("frm4.cpp", Form4);
    USEFORM("frm5.cpp", Form5);
    USEFORM("frm6.cpp", Form6);
    
    //---------------------------------------------------------------------------
    
    WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
        try
        {
    
        	FormSplash = new TFormSplash(Application);
    
           	Screen->Cursor = crHourGlass;
    
           	FormSplash->ProgressBar->Max = 100;
            FormSplash->Show();
    
            Application->Initialize();
    
           	Application->CreateForm(__classid(TForm1), &Form1);
            FormSplash->ProgressBar->StepBy(30);
            FormSplash->Label1->Caption = "Lade Formular 1";
    
            Application->CreateForm(__classid(TForm2), &Form2);
            FormSplash->ProgressBar->StepBy(20);
            FormSplash->Label1->Caption = "Lade Formular 2";
    
            Application->CreateForm(__classid(TForm3), &Form3);
            FormSplash->ProgressBar->StepBy(10);
            FormSplash->Label1->Caption = "Lade Formular 3";
    
            Application->CreateForm(__classid(TForm4), &Form4);
            FormSplash->ProgressBar->StepBy(10);
            FormSplash->Label1->Caption = "Lade Formular 4";
    
            Application->CreateForm(__classid(TForm5), &Form5);
            FormSplash->ProgressBar->StepBy(10);
            FormSplash->Label1->Caption = "Lade Formular 5";
    
            Application->CreateForm(__classid(TForm6), &Form6);
            FormSplash->ProgressBar->StepBy(20);
            FormSplash->Label1->Caption = "Lade Formular 6";
    
           FormMain->Show();
           FormSplash->Close();
           Screen->Cursor = crDefault;
           Application->Run();
    
        }
        catch (Exception &exception)
        {
            Application->ShowException(&exception);
        }
        return 0;
    }
    //---------------------------------------------------------------------------
    

    Die StepBy-Werte sind bezogen auf Formulargrösse in % am Gesamtprojekt und
    eigentlich PI * Fensterkreuz.


Anmelden zum Antworten