CMsvSession:: DeInstallMtmGroup() gives KErrInUse on Nokia 5800 although it works fine on 3rd edition devices.
Any advice?
Thanks
CMsvSession:: DeInstallMtmGroup() gives KErrInUse on Nokia 5800 although it works fine on 3rd edition devices.
Any advice?
Thanks
Some time back, i have also faced the problem(different from this) with Custom MTM in 5th devices, at that time expert said "may be its an issue with newer version".
so how did you manage to deinstall it, can you show the code.
CMsvSession* session = CMsvSession::OpenSyncL(ob);
ClearMessageEntriesL(*session);
TInt err=session->DeInstallMtmGroup(filename);
Chk the thread below:
This is a known problemhttp://www.forum.nokia.com/forum/showthread.php?t=160005
http://wiki.forum.nokia.com/index.ph...e_in_use_error
Regards,
Shafali
i am not sure, but you can try following things:
1: Get the entry root by CMsvEntry *entryRoot = session->GetEntryL( KMsvRootIndexEntryId);
2: get all the folder assosiated with your MTM like,
CMsvEntrySelection* folderEntrySelection = entryRoot->ChildrenWithTypeL(KUidMsvServiceEntry);
3: get its entry value by this,
TInt index = folderEntrySelection->Count()
CMsvEntry* entry = session->GetEntryL( folderEntrySelection->At( index) );
CMsvStore* store=entry->ReadStoreL();
4: and now remove all the folder with this entry,
CMsvEntry:: DeleteL();
5: then call TInt err = session->DeInstallMtmGroup(_("yourmtm");
hope it will help you,
I wrote the code as follows:
CMsvEntry* entryRoot = aSession.GetEntryL(KMsvRootIndexEntryId);
CleanupStack::PushL(entryRoot);
CMsvEntrySelection* folderEntrySelection = entryRoot->ChildrenWithTypeL(
KUidMsvServiceEntry);
CleanupStack::PushL(folderEntrySelection);
//TInt index = folderEntrySelection->Count();
for(TInt i=0; i<folderEntrySelection->Count(); i++)
{
//CMsvEntry* entry = aSession.GetEntryL(folderEntrySelection->At(i));
//CMsvStore* store = entry->ReadStoreL();
entryRoot->DeleteL(folderEntrySelection->At(i));
}
CleanupStack::PopAndDestroy(folderEntrySelection);
CleanupStack::PopAndDestroy(entryRoot);
and I get error -21
You may try to close the Messaging application: on 5th edition, although you don't see it running among the applications, it has the process running in background.
Just my two cents.