I'm getting the following error with the code below. I have included the header definition, and the section in the code that is causing the problem.
Error 2 error C2228: left of '.m_nCurrentWidth' must have class/struct/union d:\devel\myprojects\ISCDev
el 2005\Shared Files\Ultimate Toolbox\source\OXCaptionBa
r.cpp 1409
I'm am additionally getting with 2 other members, but have not included the code
Error 6 error C2228: left of '.m_rectPane' must have class/struct/union d:\devel\myprojects\ISCDev
el 2005\Shared Files\Ultimate Toolbox\source\OXCaptionBa
r.cpp 1442
Error 7 error C2228: left of '.m_pContainedWnd' must have class/struct/union d:\devel\myprojects\ISCDev
el 2005\Shared Files\Ultimate Toolbox\source\OXCaptionBa
r.cpp 1686
// Header ...
struct CaptionBarPane
{
public:
// default constructor
CaptionBarPane() :
m_pContainedWnd(NULL),
m_nCurrentWidth(0),
m_nMinWidth(0),
m_rectPane(0,0,0,0),
m_bShowResizeGripper(FALSE
)
{
}
// copy contructor
CaptionBarPane(const CaptionBarPane& pane) :
m_pContainedWnd(pane.m_pCo
ntainedWnd
),
m_nCurrentWidth(pane.m_nCu
rrentWidth
),
m_nMinWidth(pane.m_nMinWid
th),
m_rectPane(pane.m_rectPane
),
m_bShowResizeGripper(pane.
m_bShowRes
izeGripper
)
{
}
// assignment operator
CaptionBarPane& operator=(const CaptionBarPane& pane)
{
if(this == &pane)
{
return *this;
}
m_pContainedWnd = pane.m_pContainedWnd;
m_nCurrentWidth = pane.m_nCurrentWidth;
m_nMinWidth = pane.m_nMinWidth;
m_rectPane = pane.m_rectPane;
m_bShowResizeGripper = pane.m_bShowResizeGripper;
return *this;
}
// Attributes
public:
// control displayed in pane
CWnd* m_pContainedWnd;
// current width
int m_nCurrentWidth;
// min allowed width
int m_nMinWidth;
// pane rectangle
CRect m_rectPane;
// if true then gripper for pasne resizing will be displayed
BOOL m_bShowResizeGripper;
};
// array of all panes
CArray<CaptionBarPane,Capt
ionBarPane
&> m_arrPane;
// cpp
for(nPaneIndex = GetPaneCount() - 1; nPaneIndex >= 0 ; nPaneIndex--)
{
// THIS LINE BREAKS
nMainPaneAvailableWidth +=
m_arrPanenPaneIndex].m_nCu
rrentWidth
;
if(nMainPaneAvailableWidth
>= nMainPaneRequiredWidth)
{
(m_arrPane[nPaneIndex]).m_
nCurrentWi
dth =
(nMainPaneAvailableWidth - nMainPaneRequiredWidth);
nMainPaneAvailableWidth = nMainPaneRequiredWidth;
break;
}
else
{
m_arrPane[nPaneIndex].m_nC
urrentWidt
h = 0;
}
}
Start Free Trial