Posted by Forum_Nokia Developer_Support, firstname.lastname@example.org
on April 22, 2002 at 13:17
Firstly you shouldn't have a C (CSendAsObserver) type class on the stack (the stack is quite small on SymbianOS). It's better to either create one using new or just derive from MSendAsObserver and use *this when creating the NewL.
Note that member vairable by convention start with the letter 'i' in SymbianOS code and don't have to be pushed onto the cleanup stack. So, the declared iSendAs should either be a member variable and not on the stack or called sendAs and put on the stack (and taken off again).
Also, the TRAP macro can only trap 'Leaves' and not panics, which is what you are getting.
Here is a modified version of the code, which creates a message, adds a recipient and some text and finally saves the message in the drafts box: