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 / C++ / MFC
  4. Building a MFC App on top of a working Console Application

Building a MFC App on top of a working Console Application

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 3 Posters 1 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.
  • M Offline
    M Offline
    Marko B L
    wrote on last edited by
    #1

    Hi, I am currently building a C++ application and I want to add some gui stuff to it. Basically, it should only show the status of the basecode (I'm currently doing everything as console output), so there won't be any/much interaction with the gui and the base application. Now I want to abstract it, that I won't have to put any MFC/Gui code into the base code. So, I thought about some sort of event callback functions. Somewhere in the MFC init phase: myapp = New MyApplication; myapp->SetEvent1Callback(&MyMfcApp::Event1Callback); myapp->SetEvent2Callback(&MyMfcApp::Event2Callback); void MyMfcApp::Event1CallBack(long para) { BlinkBlink(para) } Somewhere in my Code: if(event1callback) (*eventcallback1)(para1, para2, ...); This way, I will still be able to develop the C++ basecode without mixing it with any MFC Code. You may ask why? The reason is that I want to have my C++ code gui free and change the *bling-bling* gui system later. Is it a good idea? I'm open for every comment. Greetings

    M T 2 Replies Last reply
    0
    • M Marko B L

      Hi, I am currently building a C++ application and I want to add some gui stuff to it. Basically, it should only show the status of the basecode (I'm currently doing everything as console output), so there won't be any/much interaction with the gui and the base application. Now I want to abstract it, that I won't have to put any MFC/Gui code into the base code. So, I thought about some sort of event callback functions. Somewhere in the MFC init phase: myapp = New MyApplication; myapp->SetEvent1Callback(&MyMfcApp::Event1Callback); myapp->SetEvent2Callback(&MyMfcApp::Event2Callback); void MyMfcApp::Event1CallBack(long para) { BlinkBlink(para) } Somewhere in my Code: if(event1callback) (*eventcallback1)(para1, para2, ...); This way, I will still be able to develop the C++ basecode without mixing it with any MFC Code. You may ask why? The reason is that I want to have my C++ code gui free and change the *bling-bling* gui system later. Is it a good idea? I'm open for every comment. Greetings

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Do you need any of the MFC classes? Why not just develop your console app without MFC? Mark

      M 1 Reply Last reply
      0
      • M Marko B L

        Hi, I am currently building a C++ application and I want to add some gui stuff to it. Basically, it should only show the status of the basecode (I'm currently doing everything as console output), so there won't be any/much interaction with the gui and the base application. Now I want to abstract it, that I won't have to put any MFC/Gui code into the base code. So, I thought about some sort of event callback functions. Somewhere in the MFC init phase: myapp = New MyApplication; myapp->SetEvent1Callback(&MyMfcApp::Event1Callback); myapp->SetEvent2Callback(&MyMfcApp::Event2Callback); void MyMfcApp::Event1CallBack(long para) { BlinkBlink(para) } Somewhere in my Code: if(event1callback) (*eventcallback1)(para1, para2, ...); This way, I will still be able to develop the C++ basecode without mixing it with any MFC Code. You may ask why? The reason is that I want to have my C++ code gui free and change the *bling-bling* gui system later. Is it a good idea? I'm open for every comment. Greetings

        T Offline
        T Offline
        TClarke
        wrote on last edited by
        #3

        Hi, I think it's an interesting idea. Sort of Document/View architecture on steroids. Best of Luck Tom PS. what sort of IPC are you considering?

        M 1 Reply Last reply
        0
        • M Mark Salsbery

          Do you need any of the MFC classes? Why not just develop your console app without MFC? Mark

          M Offline
          M Offline
          Marko B L
          wrote on last edited by
          #4

          No, I don't need any MFC classes internal. But I want to have visual output of the data. Is some sort of call monitor (with data transfer). The base code is already handling everything, but I want to see, when a new connections comes in (using some sort of leds), when a connection cancels and some sort of history monitor.

          1 Reply Last reply
          0
          • T TClarke

            Hi, I think it's an interesting idea. Sort of Document/View architecture on steroids. Best of Luck Tom PS. what sort of IPC are you considering?

            M Offline
            M Offline
            Marko B L
            wrote on last edited by
            #5

            TClarke wrote:

            I think it's an interesting idea. Sort of Document/View architecture on steroids.

            :laugh:

            TClarke wrote:

            PS. what sort of IPC are you considering?

            Well, I don't want to use some sort of IPC, only simple function calls. As I posted in the other post, it's some sort of calling montior, so I thought something like this: When a new connection comes in: (in my base code) if(newconnection) (ConnectEvent)(ConnectionID, CallerNumber, ...) And the MFC should then enable an (software) led or something.

            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