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. Visual Basic
  4. Console application and window application

Console application and window application

Scheduled Pinned Locked Moved Visual Basic
questioncom
12 Posts 5 Posters 2 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 Colin Angus Mackay

    Subjugate wrote:

    I need to combine both project so that i can use both function

    What you need to do is separate out the shared functionality into a Class Library and then reference the class library project in each of the other projects.

    Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

    S Offline
    S Offline
    Subjugate
    wrote on last edited by
    #3

    Sorry i don't really got what u mean as i never try something like this before. Is it possible to have a more detailed explanation? Sorry to be troublesome.

    M 1 Reply Last reply
    0
    • S Subjugate

      Sorry i don't really got what u mean as i never try something like this before. Is it possible to have a more detailed explanation? Sorry to be troublesome.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #4

      What Colin described is a basic concept of development, seperation of processes. If you have no idea of this then a forum question/answer is not going to help you, it is too brief. You need to get some education in this area, get a book and work through it.

      Never underestimate the power of human stupidity RAH

      S 1 Reply Last reply
      0
      • M Mycroft Holmes

        What Colin described is a basic concept of development, seperation of processes. If you have no idea of this then a forum question/answer is not going to help you, it is too brief. You need to get some education in this area, get a book and work through it.

        Never underestimate the power of human stupidity RAH

        S Offline
        S Offline
        Subjugate
        wrote on last edited by
        #5

        I am not sure if this is what i should do. My application is kind of confusing. I am working on a server and client kind of relationship application. My client will send a request and my server will reply. The request is related to one of my external hardware, therefore both my server and client will have to have the same hardware interface. Currently i have already established the connection between the server and the client. I need to integrate my control application of my hardware to the client and server application. So i am a bit lost at the moment and not sure if i have lost track with my concept.

        M 1 Reply Last reply
        0
        • S Subjugate

          I am not sure if this is what i should do. My application is kind of confusing. I am working on a server and client kind of relationship application. My client will send a request and my server will reply. The request is related to one of my external hardware, therefore both my server and client will have to have the same hardware interface. Currently i have already established the connection between the server and the client. I need to integrate my control application of my hardware to the client and server application. So i am a bit lost at the moment and not sure if i have lost track with my concept.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #6

          So you have a design problem. I presume the console app runs on the server and the winforms is the client app. Or maybe there is functionality that is required in both. My suggestion. Identify the functionality in the 2 apps based on their location Server, Client or Both. Build a WCF service with the Server and Both functionality and a winforms app with Client and Both. A service is basically a set of classes so seperate the Both functionality into it's own class so it can be included in the Client app as well as the service. And yes I suggest you rewrite the entire solution as your current apps sound like crap and using a converted VB6 app is asking for trouble (this is why I know your solution is crap).

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • S Subjugate

            I have 2 separate project, one running as console application and the other as window application. I need to combine both project so that i can use both function. How am i suppose to do it since both are different project type? Another question i have is that the window application project is a conversion from vb6, can it still operate as normal if i have combine the 2 project as i heard there is some limitation for activeX conversion file?:confused:

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

            AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other (such as the presence/absence of a command line switch). It seems MS made a rather unfortunate fundamental decision to that effect long time ago. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Fixturized forever. :confused:


            G 1 Reply Last reply
            0
            • L Luc Pattyn

              AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other (such as the presence/absence of a command line switch). It seems MS made a rather unfortunate fundamental decision to that effect long time ago. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Fixturized forever. :confused:


              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #8

              Luc Pattyn wrote:

              AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other

              Well, that's half true... A windows application can also have a console and work as both, but you can't optionally open the console so that a program can work as either. (Every Windows probram is actually also a MS-DOS program. If you start it from a system that doesn't have Windows installed, it runs as a MS-DOS programs that simply displays a message that the program needs Windows to run.)

              Luc Pattyn wrote:

              such as the presence/absence of a command line switch

              Both a console application and a windows application does accept a command line.

              Despite everything, the person most likely to be fooling you next is yourself.

              S L 2 Replies Last reply
              0
              • G Guffa

                Luc Pattyn wrote:

                AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other

                Well, that's half true... A windows application can also have a console and work as both, but you can't optionally open the console so that a program can work as either. (Every Windows probram is actually also a MS-DOS program. If you start it from a system that doesn't have Windows installed, it runs as a MS-DOS programs that simply displays a message that the program needs Windows to run.)

                Luc Pattyn wrote:

                such as the presence/absence of a command line switch

                Both a console application and a windows application does accept a command line.

                Despite everything, the person most likely to be fooling you next is yourself.

                S Offline
                S Offline
                Subjugate
                wrote on last edited by
                #9

                So can i assume what u trying to say is that i can have my project as window application and console application. But just that if i set my project as window application i wont be able to see my command line? But my command line is running in the background?

                G 1 Reply Last reply
                0
                • G Guffa

                  Luc Pattyn wrote:

                  AFAIK Windows is not capable of having a single EXE that runs as a console app under some circumstances and as a Windows app under other

                  Well, that's half true... A windows application can also have a console and work as both, but you can't optionally open the console so that a program can work as either. (Every Windows probram is actually also a MS-DOS program. If you start it from a system that doesn't have Windows installed, it runs as a MS-DOS programs that simply displays a message that the program needs Windows to run.)

                  Luc Pattyn wrote:

                  such as the presence/absence of a command line switch

                  Both a console application and a windows application does accept a command line.

                  Despite everything, the person most likely to be fooling you next is yourself.

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

                  AFAIK current tools (.NET or otherwise) generate EXE files according to the PE file format, which has a "console" bit somewhere, which is either set, so you are bound to get a console, or it is not set, so you can not interact with it unless you come up with some user interface. As a result you have to have two EXEs where one could otherwise be sufficient. As an example: WinZip.exe is a GUI based zipper, there is an optional wzzip.exe that offers similar zipper functionality from the console. How silly. :)

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  Fixturized forever. :confused:


                  S 1 Reply Last reply
                  0
                  • L Luc Pattyn

                    AFAIK current tools (.NET or otherwise) generate EXE files according to the PE file format, which has a "console" bit somewhere, which is either set, so you are bound to get a console, or it is not set, so you can not interact with it unless you come up with some user interface. As a result you have to have two EXEs where one could otherwise be sufficient. As an example: WinZip.exe is a GUI based zipper, there is an optional wzzip.exe that offers similar zipper functionality from the console. How silly. :)

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    Fixturized forever. :confused:


                    S Offline
                    S Offline
                    Subjugate
                    wrote on last edited by
                    #11

                    Ok, i think i got what u mean. So if i change all the things appearing in the console to a label it might work this way right? Because to me i do not need to touch anything on the console and it is like a log file to me. But i do need to retrieve request that made from my client which is display on the console.I not sure if u got me as i know is a contradicting explanation.

                    1 Reply Last reply
                    0
                    • S Subjugate

                      So can i assume what u trying to say is that i can have my project as window application and console application. But just that if i set my project as window application i wont be able to see my command line? But my command line is running in the background?

                      G Offline
                      G Offline
                      Guffa
                      wrote on last edited by
                      #12

                      A command line is not the same as a console. A command line is a string that is sent to the application when it starts. If you start an application from a console window, you type the command line after the application name, but if you start the application another way you specify the command line in some other way. If you for example start the application by dropping a file on the application file in the explorer, the command line will be the path of the dropped file.

                      Despite everything, the person most likely to be fooling you next is yourself.

                      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