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. Update Statusbar from a non-window class method.

Update Statusbar from a non-window class method.

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
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.
  • O Offline
    O Offline
    oRion
    wrote on last edited by
    #1

    I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined. :confused:

    J A 2 Replies Last reply
    0
    • O oRion

      I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined. :confused:

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      If what you want is a value being displayed in the status bar (like coordiantes in a picture-editor), try this: You set a variable in your CDocument class. This variable is then displayed via a ON_COMMAND_UPDATE_UI-handler in either your main frame or your view.

      O 1 Reply Last reply
      0
      • J jhwurmbach

        If what you want is a value being displayed in the status bar (like coordiantes in a picture-editor), try this: You set a variable in your CDocument class. This variable is then displayed via a ON_COMMAND_UPDATE_UI-handler in either your main frame or your view.

        O Offline
        O Offline
        oRion
        wrote on last edited by
        #3

        Thanks for your reply, jhwurmbach! I think I have to repharase my question. I have written a class method which does all the screen output, but the output is onto the screen via "cout". Now, I am trying to rewrite this class such that I could output my message onto the statusbar in windows instead. I understand that "CView" is the one that handles the output in windows. I am trying to change my original DOS-output class to a windows-output class one. I hope u can understand what I am trying to say. U have any suggestion? :rolleyes:

        J 1 Reply Last reply
        0
        • O oRion

          Thanks for your reply, jhwurmbach! I think I have to repharase my question. I have written a class method which does all the screen output, but the output is onto the screen via "cout". Now, I am trying to rewrite this class such that I could output my message onto the statusbar in windows instead. I understand that "CView" is the one that handles the output in windows. I am trying to change my original DOS-output class to a windows-output class one. I hope u can understand what I am trying to say. U have any suggestion? :rolleyes:

          J Offline
          J Offline
          jhwurmbach
          wrote on last edited by
          #4

          You don't want to simplay have a 'logging' style output in a Window (for that, try searching the site), you want to show one output line in the status bar, right? Do we talk about the same 'StatusBar'-thing? I talk about he same bar that in IE contains the little globe and the 'Internet' text at the right bottom of the window. in the same bar, with SSE-connection, a little yellow lock shows up. So, probably it is really easiest to let your class-method set a variable in the dochument and show that variable via ON_UPDTE_COMMNAND_UI.

          1 Reply Last reply
          0
          • O oRion

            I have written a class in a seperate file which I want access to the statusbar. How do I change the message in the statusbar from this class? I have included the "stdafx.h" in the class I defined. :confused:

            A Offline
            A Offline
            Andreas Saurwein
            wrote on last edited by
            #5

            AfxGetMainWnd()->SetMessageText();


            ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

            O 1 Reply Last reply
            0
            • A Andreas Saurwein

              AfxGetMainWnd()->SetMessageText();


              ...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]

              O Offline
              O Offline
              oRion
              wrote on last edited by
              #6

              Thanks for your reply. I have tried to use that statement u mention. It can't work, apparently SetMessageText is not a member of AfxGetMainWnd(). :confused:

              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