Cannot delete messaging folder!
Here is a code, how I create the folder on My Folders:
TMsvSelectionOrdering ordering;
CMsvEntry* iMsvEntry = CMsvEntry::NewL(*iSession,
KMsvMyFoldersEntryIdValue, ordering);
TTime date;
date.HomeTime();
_LIT(folderName, "Folder 2");
TMsvEntry folderentry;
folderentry.iType = KUidMsvFolderEntry;
folderentry.iMtm = KUidMsvLocalServiceMtm;
folderentry.iDetails.Set(folderName);
folderentry.iDescription.Set(folderName);
folderentry.iServiceId = iSmsMtm->ServiceId();
folderentry.iSize = sizeof(folderentry);
folderentry.iDate = date;
folderentry.SetStandardFolder(ETrue);
folderentry.SetVisible(ETrue);
iMsvEntry->CreateL(folderentry);
delete iMsvEntry;
The folder creates Ok, but when I try to delete this folder on messaging app, it cannot be deleted, there's access denied error. What is the problem? What I'm doing wrong? What should I add to my code?
Re: Cannot delete messaging folder!
Hi! Just one question, does the "KMsvMyFoldersEntryIdValue" constant exist?? If yes, where is it defined? I'm searching in headers of all Series 60 SDK's, and it doesn't appear.
Thnx!
Re: Cannot delete messaging folder!
Hello, it's not defined anywhere. I just found it's value by myself and it's value is equal to 0x1008
Re: Cannot delete messaging folder!
Thnx for your fast reply. Just anything more, I'm facing the same problem you told on first post, once the folder is created, I can't modify or delete it from messaging application. How, did you solve this?
Bye!
Re: Cannot delete messaging folder!
Unfortunately I couldn't solve this problem yet
Please contact me if you'll do this :)
Re: Cannot delete messaging folder!
Hi again! I have it. Finally I tried the same code used to create a message entry, just changing the kind of entry and its parent folder.
TMsvId msvServId;
CMsvEntry *entry = NULL;
CMsvEntry * rootEntry = NULL;
CMsvEntry *entryRootService = NULL;
CMsvEntrySelection * entrySelectionP = NULL;
TInt newFldrID = 0;
_LIT(KFolderName,"TEST");
//Get the entry (whatever is passed in)
entry = iMsvSession->GetEntryL(KMsvMyFoldersEntryIdValue);
CleanupStack::PushL(entry);
if (entry)
{
msvServId = entry->OwningService();
entryRootService = iMsvSession->GetEntryL(msvServId);
CleanupStack::PushL(entryRootService);
rootEntry = iMsvSession->GetEntryL(msvServId);
CleanupStack::PushL(rootEntry);
rootEntry->SetEntryL(KMsvMyFoldersEntryIdValue); // set to parent
TMsvEntry newServiceEntry;
TTime ttime;
ttime.HomeTime();
newServiceEntry.iDate = ttime;
newServiceEntry.iSize = 0;
newServiceEntry.iType = KUidMsvFolderEntry;
newServiceEntry.iMtm = KUidMsvLocalServiceMtm;
newServiceEntry.iServiceId = KUidMsvLocalServiceMtmValue;
newServiceEntry.iDetails.Set(KFolderName);
newServiceEntry.iDescription.Set(KNullDesC);
rootEntry->CreateL(newServiceEntry);
newFldrID = newServiceEntry.Id();
CleanupStack::PopAndDestroy();
CleanupStack::PopAndDestroy();
}
CleanupStack::PopAndDestroy(); // entry
Hope it helps.
Bye!!
P.D. I'll post the link where I found the code shown above, there could be more usefull information for you:
[url]http://discussion.forum.nokia.com/forum/showthread.php?t=44794&highlight=create+messaging+folder[/url]
Re: Cannot delete messaging folder!