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

simple (?!) string problem

0 replies · 1,388 views · Started 05 October 2004

The following code generates a runtime error at the iMobilNrEdwin->SetTextL( &str() ); line. Why?

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

iMobilNrEdwin = new (ELeave) CEikEdwin;
iMobilNrEdwin->SetContainerWindowL( *this );
_LIT(str, "Add tel no here"😉;
iMobilNrEdwin->SetTextL( &str() );

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

SetRect(aRect);
ActivateL();
}

//The call to ConstructL:

void CTerminalAppAppUi::ConstructL()
{
BaseConstructL();
iAppContainer = new (ELeave) CTerminalAppContainer;
iAppContainer->SetMopParent(this);
iAppContainer->ConstructL( ClientRect() );
AddToStackL( iAppContainer );
}