读书人

新人SetRect时候出错咋回事

发布时间: 2012-01-20 18:53:53 作者: rapoo

新人求助,SetRect时候出错怎么回事?
刚开始接触S60的开发,用的是S60 2nd Ed,FP2
我想在屏幕上添加一个CEikEdwin
CEikEdwin *iMyContral;

void CMyApplicationContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();

iLabel = new (ELeave) CEikLabel;
iLabel-> SetContainerWindowL( *this );
iLabel-> SetTextL( _L( "Example View ") );

iMyContral = new (ELeave) CEikEdwin;
iMyContral-> SetContainerWindowL(*this);

iToDoLabel = new (ELeave) CEikLabel;
iToDoLabel-> SetContainerWindowL( *this );
iToDoLabel-> SetTextL( _L( "Add Your controls\n here ") );

SetRect(aRect);
iBackGround = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, Rect(), EFalse );
ActivateL();
}
在SetRect的时候总是报错,怎么回事?
头一次做S60的程序,n多地方不懂,请各位点拨点拨,谢了

[解决办法]
问题比较奇怪,怀疑不是SetRect()出的问题,建议楼在CMyApplicationContainer的所有成员函数都加上断点然后Debug一下.
[解决办法]
把 SetRect(aRect) 放在 CreateWindowL() 前面 试试

读书人网 >Symbian

热点推荐