Read-only archive of the All About Symbian forum (2001–2013) · About this archive

ceikcolumnlistbox problem

2 replies · 2,738 views · Started 10 March 2003

this is a beginner's question so please forgive me if it seems stupid.. 😞

class CMyTest2AppView : public CCoeControl, public MCoeControlObserver
{
public:
CEikColumnListBox *cTaskListBox;
~CMyTest2AppView();
void ConstructL(const TRect& aRect);
private:
void Draw(const TRect& /*aRect*/) const;
void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
};

void CMyTest2AppView::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
cTaskListBox = new(ELeave) CEikColumnListBox;
cTaskListBox->ConstructL(this, 0);
CDesCArray *txt = (CDesCArray *)cTaskListBox->Model()->ItemTextArray();
ActivateL();
}

why is it that on the line that goes "CDesCArray *txt = (CDesCArray *)cTaskListBox->Model()->ItemTextArray();", i get a compiler error of an illegal use of incomplete struct/union/class CTextListBoxModel?? in fact, if i try to access any members of Model() from cTaskListBox, i get the same compiler error. are there some virtual functions that i've failed to override???

Try:
CDesCArray *txt = (CDesCArray *)cTaskListBox->Model().ItemTextArray();

If you are using UIQ_70 SDK there is a mistake (and this is not the only one) in the documentation. The SDK says to include eiktxlbx.h, while it is supposed to be eiktxlbm.h.