Saturday, January 16, 2016

Why I do not have messaging?




            


I added on the basis of Hello world menu:
MENU_ITEM
{
command = ESymbian2Command1;
txt = qtn_hewb_command1;
},
MENU_ITEM
{
command = ESymbian2Command2;
txt = qtn_hewb_command2;
},
MENU_ITEM
{
command = EAknSoftkeyExit;
txt = qtn_hewb_exit;
}
enum TSymbian2Ids
{
ESymbian2Command1 = 1, // start value must not be 0
ESymbian2Command2 = 2,
Esymbian2Command3
};
In HandleCommandL added processing code: Displays the current time
case ESymbian2Command2:
{
TTime * tCurrTime = new (ELeave) TTime;
tCurrTime- & gt; HomeTime ();
_LIT (INIT, "% Y.% M.% D% H:% T:% S");
TDesC tdscTimeFormat = INIT;
HBufC * heapBuf = HBufC :: NewL (100);
TDes timeTDes = heapBuf- & gt; Des ();
tCurrTime- & gt; FormatL (timeTDes, tdscTimeFormat);
CAknInformationNote * informationNote = new (ELeave) CAknInformationNote;
informationNote- & gt; ExecuteLD (* heapBuf);
CleanupStack :: PopAndDestroy (heapBuf);
}
But after a good run I compiled, I built a menu selection program error handler said I did not know why, please give pointers about the younger
Reply:
case ESymbian2Command2:
{
...
break; // & lt; == forget to add a break statement
?}
Reply:
No delete informationNote
Reply:
Ha ha.

Upstairs, the basics, but off.
informationNote- & gt; ExecuteLD (* heapBuf);
L indicates that this function after the function Leave, D represents the function Delete put myself out.

symbian function suffix divided among: L, C, D and so on. C represents the implementation of this function will own pushed CleanupStack.

No comments:

Post a Comment