HyperEngineer
Programmer
I have a dialog based application and want to have a status bar at the bottom of the window. In the header file I have the definition:
Code:
protected:
CStatusBar m_wndStatusBar;
At the beginning of the MyProgDlg.cpp file I have the following structure:
Code:
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
Then in the OnInitDialog() I have the following code:
Code:
m_wndStatusBar = new CStatusBar();
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
It compiles fine, but when I run the program I don't see a status bar.
HyperEngineer
If it ain't broke, it probably needs improvement.