// CActiveScheduler::Start(); // here i get error (Program Closed. MSGS 259) // if i dont call this then project compiles // but entry isnt changed/updated.
I take it that CMsvOperationWait is an active object that you have written that is ment to wait until the asynchronous call ChangeL has completed?. What I think you actually wanted to put in there is:
above code (updating msgEntry later) works fine when i create a sms in Inbox locally using following code. But dont work when a sms arrives from some other phone.
anybody could tell me why it dont work (
//Create message in Ibox iSmsMtm->SwitchCurrentEntryL(aFolderId); iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid); //iSmsMtm->AddAddresseeL(aAddress); //to address if need
Forum posts: 51
I take it that CMsvOperationWait is an active object that you have written that is ment to wait until the asynchronous call ChangeL has completed?. What I think you actually wanted to put in there is:
TRequestStatus status;
CMsvOperation *theOp = msgEntry->ChangeL(tEntry,theWaiter->status);
CleanupStack::PushL(theOp);
User::WaitForRequest(status);
User::LeaveIfError(status);
CleanupStack::PopAndDestroy(theOp);
B
above code (updating msgEntry later) works fine when i create a sms in Inbox locally using following code. But dont work when a sms arrives from some other phone.
anybody could tell me why it dont work
//Create message in Ibox
iSmsMtm->SwitchCurrentEntryL(aFolderId);
iSmsMtm->CreateMessageL(KUidMsgTypeSMS.iUid);
//iSmsMtm->AddAddresseeL(aAddress); //to address if need
CMsvStore* aMessageStore = iSmsMtm->Entry().EditStoreL();
CleanupStack::PushL(aMessageStore);
CSmsHeader& iHeader = iSmsMtm->SmsHeader();
iHeader.SetFromAddressL(aAddress);
iHeader.StoreL(*aMessageStore);
CleanupStack::PopAndDestroy(aMessageStore);
CRichText& body = iSmsMtm->Body();
body.Reset();
body.InsertL(0, aMessage);
TMsvEntry entry = iSmsMtm->Entry().Entry();
entry.SetInPreparation(EFalse);
entry.SetVisible(ETrue);
entry.iDate.HomeTime();
entry.iDescription.Set(aDescription);
entry.iDetails.Set(aAddress);
entry.SetUnread(ETrue);
iSmsMtm->Entry().ChangeL(entry);
iSmsMtm->SaveMessageL();