Sms inbox missing data

Login to reply to this topic.
Wed, 2005-08-10 12:20
Joined: 2005-03-04
Forum posts: 12
Hi have have done a small function to get the data from the inbox all works fine exept
i only get 32 first bit why? the documatation doent say any thing

Code:
CMsvEntry *pMsvEntry = iMsvSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
  size.Copy(_L("SMS Sent: "));
  size.AppendNum( pMsvEntry->Count());

  for(int i= 0; i < pMsvEntry->Count(); i++)
  {
iDetailstemp.Copy((*pMsvEntry)[i].iDetails);
iClient->IssueWrite(iDetailstemp);
iDescriptiontemp.Copy((*pMsvEntry)[i].iDescription);
iClient->IssueWrite(iDescriptiontemp);
  }

*pMsvEntry)[i].iDetails
*pMsvEntry)[i].iDescription

cant take more that 32 ´letters why? what have i missed tnx in advance

Thu, 2005-08-11 04:43
Joined: 2003-04-01
Forum posts: 142
Re: Sms inbox missing data
if you want the sms message, you should read it from the message body, not from the description. Check mtm classes for more information.

yucca
Thu, 2005-08-11 15:58
Joined: 2005-03-04
Forum posts: 12
Re: Sms inbox missing data
Tnx for your helpbut i got this pice of Code but i cant make it work ir just crash i can se why.


The function
Code:
CBaseMtm *ptriMtmRegistry = (CBaseMtm *)(CClientMtmRegistry::NewL(*iMsvSession));
  CClientMtmRegistry *iMtmRegistry = CClientMtmRegistry::NewL(*iMsvSession);
  CSmsClientMtm* ptrSmsMtm = static_cast<CSmsClientMtm *> (iMtmRegistry->NewMtmL(KUidMsgTypeSMS));///// it dies Here !!! any WHY

  ptrSmsMtm ->SwitchCurrentEntryL(msvEntry.Id());
  ptrSmsMtm ->LoadMessageL();   
  CRichText &body = ptrSmsMtm->Body();

.h file
Code:
class CTimeMContainer : public CCoeControl, public MCoeControlObserver, public MMsvSessionObserver{
private:
CMsvSession* iMsvSession; // Message session
public:
.
.
.
private: // from MMsvSessionObserver
void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);

in the .cpp
Code:

void CTimeMContainer::ConstructL(const TRect& aRect)
{
iMsvSession = CMsvSession::OpenAsyncL(*this);
...
}
.
.
.
.


void CTimeMContainer::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3)
{
// If various server error conditions occur, set an error flag
if (
(aEvent==EMsvGeneralError) // Something has happening in the server, but this client was unable to retrieve the information. aArg1 points to the error code.
|| (aEvent==EMsvCloseSession) // The client should immediately close the session with the Message Server.
|| (aEvent==EMsvServerFailedToStart) // Received after a client has used CMsvSession::OpenAsyncL() to create a session. The server could not be started, and aArg1 points to the error code.
|| (aEvent==EMsvServerTerminated) // The Message Server has been terminated. All clients must close their sessions immediately.
)
iErrFlag=EFalse;
}

please Help me any one
Fri, 2005-08-12 04:55
Joined: 2005-04-12
Forum posts: 58
Re: Sms inbox missing data
I am extracting the body text the following way and it works fine:

CRichText* richText = CRichText::NewL(CEikonEnv::Static()->SystemParaFormatLayerL(), CEikonEnv::Static()->SystemCharFormatLayerL());
CleanupStack::PushL(richText);

CSmsHeader* mySmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*richText);
CleanupStack::PushL(mySmsHeader);

CMsvEntry* tmpEntry = iSession->GetEntryL(aMessageId);
CleanupStack::PushL(tmpEntry);

if(tmpEntry->HasStoreL())
{
   CMsvStore* store = tmpEntry->ReadStoreL();
   CleanupStack::PushL(store);
   mySmsHeader->RestoreL(*store);
   store->RestoreBodyTextL(*richText);
   CleanupStack::PopAndDestroy(store);
}


TInt messageLength = mySmsHeader->Message().Buffer().Length();
mySmsHeader->Message().Buffer().Extract(smsBody, 0, messageLength);

//tale care of cleaning up the stack.

Regards,
Peri

  • Login to reply to this topic.