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