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. Problem updating the status bar

Problem updating the status bar

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 2 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.
  • L Offline
    L Offline
    ledallam
    wrote on last edited by
    #1

    Hi, I have a form view class derived from CFormView. In this class I have a thread which does some processing for every 30 seconds and generates a status message which is of type CString. I need to show this message in the Status Bar. From within the form view class I am calling a method names UpdateOnlineStatusMessage in the Frame Window class which updates the status bar. void UpdateOnlineStatusMessage(CString strMsg) { PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex); } Here m_wndStatusBar member that represents the status bar in the FrameWindow calss. I am getting an assertion while trying to access m_wndStatusBar member. Can anyone please help me to solve this. Thanks Madhavi.

    T 2 Replies Last reply
    0
    • L ledallam

      Hi, I have a form view class derived from CFormView. In this class I have a thread which does some processing for every 30 seconds and generates a status message which is of type CString. I need to show this message in the Status Bar. From within the form view class I am calling a method names UpdateOnlineStatusMessage in the Frame Window class which updates the status bar. void UpdateOnlineStatusMessage(CString strMsg) { PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex); } Here m_wndStatusBar member that represents the status bar in the FrameWindow calss. I am getting an assertion while trying to access m_wndStatusBar member. Can anyone please help me to solve this. Thanks Madhavi.

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      ledallam wrote:

      Here m_wndStatusBar member that represents the status bar in the FrameWindow calss.

      Could you please show us! How do you connect the StatusBar member of MainFrame with m_wndStatus? i believe that the root cause of problem... you can try this too ->

      CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
      if(pMain)
      {
      PANEINFOEX pex;
      pex.iIndex = 0;
      pex.strText = strMsg;
      pex.iFlags = SBP_ID | SBP_TEXT;
      pMain->STATUSBAR_MEMBER-> or . SetPaneInfoEx(&pex);
      }

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      cheers, Alok Gupta VC Forum Q&A :- I/ IV

      L 1 Reply Last reply
      0
      • T ThatsAlok

        ledallam wrote:

        Here m_wndStatusBar member that represents the status bar in the FrameWindow calss.

        Could you please show us! How do you connect the StatusBar member of MainFrame with m_wndStatus? i believe that the root cause of problem... you can try this too ->

        CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
        if(pMain)
        {
        PANEINFOEX pex;
        pex.iIndex = 0;
        pex.strText = strMsg;
        pex.iFlags = SBP_ID | SBP_TEXT;
        pMain->STATUSBAR_MEMBER-> or . SetPaneInfoEx(&pex);
        }

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV

        L Offline
        L Offline
        ledallam
        wrote on last edited by
        #3

        The status bar is a member of mainfrme class itself and the function that updated the status bar is also in the main frame, so I use it directly. I'll call the function that updates the status bar from my form view calss

        1 Reply Last reply
        0
        • L ledallam

          Hi, I have a form view class derived from CFormView. In this class I have a thread which does some processing for every 30 seconds and generates a status message which is of type CString. I need to show this message in the Status Bar. From within the form view class I am calling a method names UpdateOnlineStatusMessage in the Frame Window class which updates the status bar. void UpdateOnlineStatusMessage(CString strMsg) { PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex); } Here m_wndStatusBar member that represents the status bar in the FrameWindow calss. I am getting an assertion while trying to access m_wndStatusBar member. Can anyone please help me to solve this. Thanks Madhavi.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          ledallam wrote:

          PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex);

          Are you using your custom CStatusBar Class. as i couldn't found SetPaneInfoEx and PANEINFOEX in My Local MSDN Copy (APril2004)!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV

          L 1 Reply Last reply
          0
          • T ThatsAlok

            ledallam wrote:

            PANEINFOEX pex; pex.iIndex = 0; pex.strText = strMsg; pex.iFlags = SBP_ID | SBP_TEXT; m_wndStatusBar.SetPaneInfoEx(&pex);

            Are you using your custom CStatusBar Class. as i couldn't found SetPaneInfoEx and PANEINFOEX in My Local MSDN Copy (APril2004)!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            L Offline
            L Offline
            ledallam
            wrote on last edited by
            #5

            Yes I am using custom CStatusBar Class.

            T 1 Reply Last reply
            0
            • L ledallam

              Yes I am using custom CStatusBar Class.

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #6

              ledallam wrote:

              Yes I am using custom CStatusBar Class.

              Then Please list the code of that Custom Function

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV

              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