Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Application.Run() [modified]

Application.Run() [modified]

Scheduled Pinned Locked Moved C#
questioncsharp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chaitanya Joshi
    wrote on last edited by
    #1

    Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007

    K L C C 4 Replies Last reply
    0
    • C Chaitanya Joshi

      Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007

      K Offline
      K Offline
      Kristian Sixhoj
      wrote on last edited by
      #2

      I'm almost 100% sure, that it is necessary. Your application needs to be executed somewhere in the code.

      Virtual1ty


      "Any fool can learn from his own mistakes, but a wise man learns from mistakes of others"

      1 Reply Last reply
      0
      • C Chaitanya Joshi

        Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, to have a live Windows app, showing Windows and reacting to the user, you need a "message pump", i.e. an event queue that collects GUI events, and a loop that reads from that queue and executes the messages. The normal way to achieve this is by calling Application.Run(); there may be other ways to achieve the same, but nothing as simple as the one line that does everything that is required. BTW: you don't need Application.Run() when you don't need the message pump, as in a Console app. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        this months tips: - use PRE tags to preserve formatting when showing multi-line code snippets - before you ask a question here, search CodeProject, then Google


        1 Reply Last reply
        0
        • C Chaitanya Joshi

          Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Question - why do you think it's there, if it's not necessary ? Why do you want to bypass it ?

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • C Chaitanya Joshi

            Hi to All, This is my first aquaintance with the forum as I am new to this forum as well as C# also. So the question may be foolish & yet it prevails. Hope you understand me .. Q: Is Application.Run() function always necessary to display your form? Can't we bypass it? I tried to do and my form instance was just flashing and exiting... Thanks in anticipation.. Regards -- modified at 3:25 Sunday 14th October, 2007

            C Offline
            C Offline
            Chaitanya Joshi
            wrote on last edited by
            #5

            Thanks to all ... Really.. So now I get that the message pump that is required is provided by Application.Run(). Otherwise the application would die without any messages.. Thanks once again folks.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups