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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Create two executable files ( one GUI and one command line )

Create two executable files ( one GUI and one command line )

Scheduled Pinned Locked Moved C / C++ / MFC
c++
6 Posts 3 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.
  • A Offline
    A Offline
    Arif Liminto
    wrote on last edited by
    #1

    Hi, in MFC 2003, Is that possible to create two executable files (.exe) one for GUI and one for command line, so I can choose to run the application via GUI or via command line Thanks Arif

    C K 2 Replies Last reply
    0
    • A Arif Liminto

      Hi, in MFC 2003, Is that possible to create two executable files (.exe) one for GUI and one for command line, so I can choose to run the application via GUI or via command line Thanks Arif

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      One way to do it would be to separate your 'core' from your UI. If you develop a dll (or a lib file) which contains all the core functionalities, that will be easier to develop the two other applications. But of course, you will still need to develop them and the way you will do it really depends of what you need to do.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      A 1 Reply Last reply
      0
      • C Cedric Moonen

        One way to do it would be to separate your 'core' from your UI. If you develop a dll (or a lib file) which contains all the core functionalities, that will be easier to develop the two other applications. But of course, you will still need to develop them and the way you will do it really depends of what you need to do.

        Cédric Moonen Software developer
        Charting control [v1.5] OpenGL game tutorial in C++

        A Offline
        A Offline
        Arif Liminto
        wrote on last edited by
        #3

        Thanks for the quick reply, I 've put all of my core functionalities in different classes, and the problem is I don't know how to creating command line executable files, because when the first time, I create MFC Dialog Based Not Command Line Application, Any suggestion? Thanks Arif

        C 1 Reply Last reply
        0
        • A Arif Liminto

          Hi, in MFC 2003, Is that possible to create two executable files (.exe) one for GUI and one for command line, so I can choose to run the application via GUI or via command line Thanks Arif

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #4

          You can do it in one executable. You need to separate your "working" code from the gui-code (classes). This is always a good idea beacuse of better reuse of code. :cool: :cool: :cool: In the command-line (or registry) for the app you need a parameter to control the behavior. plain example: int main(...) { CWorking work; work.DoStuff(); //showing the data? if( bGui == true ) { CGuiDialog dlg( &work ); dlg.DoModal(); } return 0; } I use a lot of may classes/code in different projects.

          Greetings from Germany

          1 Reply Last reply
          0
          • A Arif Liminto

            Thanks for the quick reply, I 've put all of my core functionalities in different classes, and the problem is I don't know how to creating command line executable files, because when the first time, I create MFC Dialog Based Not Command Line Application, Any suggestion? Thanks Arif

            C Offline
            C Offline
            Cedric Moonen
            wrote on last edited by
            #5

            Do it as I suggested: create three projects in your solution. One for the dll (or lib), one for the dialog based app and one for the command line app.

            Cédric Moonen Software developer
            Charting control [v1.5] OpenGL game tutorial in C++

            A 1 Reply Last reply
            0
            • C Cedric Moonen

              Do it as I suggested: create three projects in your solution. One for the dll (or lib), one for the dialog based app and one for the command line app.

              Cédric Moonen Software developer
              Charting control [v1.5] OpenGL game tutorial in C++

              A Offline
              A Offline
              Arif Liminto
              wrote on last edited by
              #6

              HI, Sorry for the late reply, I decided to create class that inherits from commandlineinfo and until now, I dont have any issues Anyway, Thanks for your help Regards, Arif Liminto

              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