Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
 

Talk:How to create a SMS with attachment in inbox

From Forum Nokia Wiki

CMsvSession* messageSession; CClientMtmRegistry* registry; TFileName details; TFileName description; TFileName fileName; TEntryInfoHolder infoHolder;

messageSession = CMsvSession::OpenSyncL(*this); CleanupStack::PushL(messageSession);

registry = CClientMtmRegistry::NewL( *messageSession ); CleanupStack::PushL( registry );

infoHolder.messageSession = messageSession; infoHolder.iEntryId = 0; // No entry yet ! CleanupStack::PushL( TCleanupItem( DeleteEntry, &infoHolder ) );

// Subject _LIT(KSub, "InterGrafx"); details.Copy( KSub() );

// Description description.Copy( igpFileName );

// Get message inbox CMsvEntry* inbox=messageSession->GetEntryL( KMsvGlobalInBoxIndexEntryIdValue ); CleanupStack::PushL( inbox );

TMsvEntry newEntry;


// Child entry of inbox // TMsvEntry


Best regards http://www.devdiv.net

  1. ifdef __UIQV21__

newEntry.iMtm = TUid::Uid( KUidMsgTypeBT );

  1. endif
  1. ifdef __S60V12__

newEntry.iMtm = TUid::Uid( KUidMsgTypeBt );

  1. endif //
  2. ifdef __S60V22__

newEntry.iMtm = TUid::Uid( KUidMsgTypeBt.iUid );

  1. endif //__S60V22__

newEntry.SetVisible( EFalse ); newEntry.SetInPreparation( ETrue ); newEntry.iType = KUidMsvMessageEntry; newEntry.iServiceId = KMsvUnknownServiceIndexEntryId; newEntry.iDate.HomeTime(); newEntry.iSize = 120553;//todo newEntry.iDetails.Set( details ); newEntry.iDescription.Set( description );

// For bio // For future usage //newEntry.iBioType = 0x101F3CD9; //newEntry.iMtmData3 = 1; //KMmsMessageMRetrieveConf | KMmsMessageMobileTerminated; // this defines MT message //newEntry.iMtmData1 = 0; //newEntry.iMtmData2 = 0; //TUid aTypeUid; //aTypeUid.iUid = 0x10000F6A; //newEntry.iType = aTypeUid; //TUid aMtmUid; //aMtmUid.iUid = 0x10001262; //newEntry.iMtm = aMtmUid;

inbox->CreateL(newEntry); infoHolder.iEntryId=newEntry.Id();

CClientMtmRegistry* mtmReg = CClientMtmRegistry::NewL( *messageSession ); CleanupStack::PushL( mtmReg );

// Child entry of inbox // CMsvEntry CMsvEntry* entry = messageSession->GetEntryL( newEntry.Id() ); CleanupStack::PushL( entry );

CBaseMtm *mtm = mtmReg->NewMtmL( entry->Entry().iMtm ); // takes ownership // The attachment will belong to it mtm->SetCurrentEntryL( entry ); CleanupStack::Pop(); // entry CleanupStack::PushL( mtm );

// Create an empty attachment // On return, we get values of attachmentId, tempfileName TFileName tempfileName; TMsvId attachmentId; mtm->CreateAttachmentL( attachmentId, tempfileName );

// Construct the path of the file to be created as attachment HBufC* completeFilePath = HBufC::NewLC( 500 ); TPtr completeFilePathPtr = completeFilePath->Des(); completeFilePathPtr.Append( tempfileName ); completeFilePathPtr.Append( description );


Best regards http://www.devdiv.net

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia 
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX