Simon Pettman
April 1st, 1999, 05:52 AM
I have declared
*** CProgressCtrl m_progress;
In CmainFrm.
Declared ID_PROGRESS in the string table. Added it to the indicators.
*** static UINT indicators[] =
*** {
*** ID_SEPARATOR, // status line indicator
*** ID_PROGRESS,
*** ID_X,
*** ID_Y,
*** ID_Z,
*** ID_R,
*** ID_THETA
*** };
I have created the control with the following code.
*** index=0;
*** while(m_wndStatusBar.GetItemID(index)!=ID_PROGRESS) // finds the index
*** index++;
*** m_wndStatusBar.GetItemRect(index,&rect); // get size and position of ID_PROGRESS
***
*** if(!m_progress.Create( WS_VISIBLE
*** | WS_CHILD | PBS_SMOOTH | WS_BORDER,
*** rect,&m_wndStatusBar,ID_PROGRESS)) // maybe &m_wndStatusBar is wrong
*** {
*** AfxMessageBox("Failed to create progress bar\n");
*** // fail to create
*** }
No message is generated so I assume that the creation is successful.
However, when I obtain a pointer to the CmainFrm, and try and update the control from elsewhere (or even in the
CmainFrm itself). Nothing is displayed! Can you see what’s wrong.
*** pFrame->m_progress.SetRange32(0,nCount);
*** pFrame->m_progress.SetStep(1);
*** for (…/* some loop */..)
*** {
*** pFrame->m_progress.StepIt();
*** }
Simon Pettman
*** CProgressCtrl m_progress;
In CmainFrm.
Declared ID_PROGRESS in the string table. Added it to the indicators.
*** static UINT indicators[] =
*** {
*** ID_SEPARATOR, // status line indicator
*** ID_PROGRESS,
*** ID_X,
*** ID_Y,
*** ID_Z,
*** ID_R,
*** ID_THETA
*** };
I have created the control with the following code.
*** index=0;
*** while(m_wndStatusBar.GetItemID(index)!=ID_PROGRESS) // finds the index
*** index++;
*** m_wndStatusBar.GetItemRect(index,&rect); // get size and position of ID_PROGRESS
***
*** if(!m_progress.Create( WS_VISIBLE
*** | WS_CHILD | PBS_SMOOTH | WS_BORDER,
*** rect,&m_wndStatusBar,ID_PROGRESS)) // maybe &m_wndStatusBar is wrong
*** {
*** AfxMessageBox("Failed to create progress bar\n");
*** // fail to create
*** }
No message is generated so I assume that the creation is successful.
However, when I obtain a pointer to the CmainFrm, and try and update the control from elsewhere (or even in the
CmainFrm itself). Nothing is displayed! Can you see what’s wrong.
*** pFrame->m_progress.SetRange32(0,nCount);
*** pFrame->m_progress.SetStep(1);
*** for (…/* some loop */..)
*** {
*** pFrame->m_progress.StepIt();
*** }
Simon Pettman