Announcement

Collapse
No announcement yet.

Builder Application ohne Form

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Builder Application ohne Form

    Hallo,

    kann mir bitte jemand einen Tip geben, wie ich vorgehen muß, wenn ich eine Applikation ohne TForm Klasse und ohne Konsole schreiben möchte. Ich möchte z.B. nur im Hintergrund einen Wert per TTimer an Excel senden.

    Gruß,
    Stefan

  • #2
    Geht nicht. Das liegt nicht am Builder, sondern irgendeine Anwendung musst du schon erstellen

    Programm (Konsole/Windows)

    Dienst

    In deinem Fall würde ich eine Windowsapplication erstellen, die versteckt im Tray läuft oder eine Konsolenanwendung mit WINMAIN (Konsolenexperte
    Christian

    Comment


    • #3
      <html>

      <head>
      <meta http-equiv="Content-Type"
      content="text/html; charset=iso-8859-1">
      <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
      <title>Normale Seite ohne Titel</title>
      </head>

      <body bgcolor="#FFFFFF">

      <p>Warum sollte das nicht gehen? Erzeuge Dir ein einfaches
      Formular, und schmeiß alles raus, was Du nicht haben willst:</p>

      <p>&nbsp;</p>

      <pre>#include &lt;vcl.h&gt;
      #pragma hdrstop

      WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
      {
      MessageBox(NULL,&quot;&quot;,&quot;&quot;,MB_OK);
      return 0;
      }</pre>

      <p>&nbsp;</p>
      </body>
      </html&gt
      Günther

      Comment


      • #4
        Das ist dan eine Konsolenanwendung mit WinMain -> Siehe Konsolenexperte

        Das geht nicht bezog sich darauf, das eben keine Anwendung und keine Konsole genutzt werden sollte
        Christian

        Comment


        • #5
          In der Konsolenanwendung wird windows.h und condefs.h includiert. Er braucht aber einen TTimer, und damit die VCL.h. Was er mit Konsole meint, ist das häßliche DOS-Fenster
          Günther

          Comment


          • #6
            Warum nicht so?<BR>
            Normales Projekt anlegen<BR>
            MainForm löschen<BR>
            Nach Application->Run() das eigentliche Programm aufrufen:<BR>

            <PRE>
            #include <vcl.h>
            #pragma hdrstop
            USERES("Project1.res");
            //---------------------------------------------------------------------------
            WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
            {
            try
            {
            Application->Initialize();
            Application->Run();
            Application->MessageBox ("Text", "Text", MB_OK);
            }
            catch (Exception &exception)
            {
            Application->ShowException(&exception);
            }
            return 0;
            }
            //---------------------------------------------------------------------------
            </PRE>

            Application->Running wird zwar auf false gesetzt, die Anwendung läuft jedoch weiter

            Comment


            • #7
              @Günther

              Also bei meinem Konsolenexperten kann ich auswählen:

              C oder C++

              VCL
              CLX
              Threads
              Console

              Also alles um eine Anwendung ohne Fenster zu erstellen.

              Die Auswahl Console und C++ ergibt:

              <pre>
              //---------------------------------------------------------------------------

              #include <windows.h>
              #pragma hdrstop

              //---------------------------------------------------------------------------

              #pragma argsused
              WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
              {
              return 0;
              }
              //---------------------------------------------------------------------------

              </pre>

              Die Auswahl und C++ und VCL ergibt:

              <pre>

              #include <vcl.h>
              #include <windows.h>
              #pragma hdrstop

              //---------------------------------------------------------------------------

              #pragma argsused
              WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
              {
              return 0;
              }
              //---------------------------------------------------------------------------

              </pre>

              Alles was das Herz begehrt

              &#10
              Christian

              Comment


              • #8
                Na, dann ist ja alles bestens. Ich hab ja auch nur den uralten Builder 4.0..
                Günther

                Comment

                Working...
                X