: Doesn't this save your data to the system ini file?! That's supposed to be : banned (see KB at Symbiandevnet).
You are right - it does save it as a stream in the system.ini file.
For ER5, this was the prefered technique. IIRC, this is how the Word application does it (source code was supplied with the SDK). I don't remember for ER6.0, but I think it was still allowed then.
: Instead you should open the ini file using CEikApplication::OpenIniFileLC.
For ER6.1, the functionality was removed from CAknAppUi, so you need to use CEikAppUi to get it.
For ER7.0 it is there again.
So, it may/may not be the preferred technique, depending on what platform you are using.
I use it on all platforms, but only to save 16 bytes of data (registration code and GUI prefs). It is not the place to store large amounts of data. This would need to go into a application specific config file.
I do it just as described here (using my own .ini, not the system one) or in the books. The problem is that the .ini file gets longer with every start of the program. Peeking into it, it seems that instead of storing the data into the same place, it starts a new stream inside the file each and every time.
Forum posts: 17
void CMyAppUi::ReadIniFileL ()
{
CDictionaryStore* iniFile=CDictionaryFileStore::SystemLC (iEikonEnv->FsSession ());
if (iniFile->IsPresentL (KUidUserApp)) {
RDictionaryReadStream stream;
stream.OpenLC (*iniFile, KUidUserApp);
idata=stream.ReadInt32L ();
CleanupStack::PopAndDestroy ( /* stream */ );
}
CleanupStack::PopAndDestroy ( /* iniFile */ );
}
void CMyAppUi::WriteIniFileL ()
{
CDictionaryStore* iniFile=CDictionaryFileStore::SystemLC (iEikonEnv->FsSession ());
RDictionaryWriteStream stream;
stream.AssignLC (*iniFile, KUidUserApp);
stream.WriteInt32L (iData);
stream.CommitL ();
CleanupStack::PopAndDestroy ( /* stream */ );
iniFile->CommitL ();
CleanupStack::PopAndDestroy ( /* iniFile */ );
}
Greg
--
Greg Roach, Stony Stratford, Bucks, England, greg@subaqua.co.uk
"Don't eat animals - it's not good for them and they don't like it"
Forum posts: 70
Thank you very much for the help. It is working fine.
But I wonder where it is storing the data
Can u just tell me in which file the data is stored
Thanks a lot
MeenuJ
Forum posts: 17
: Can u just tell me in which file the data is stored
/system/apps/YOUR_APP/YOUR_APP.ini
Greg
--
Greg Roach, Stony Stratford, Bucks, England, greg@subaqua.co.uk
"Don't eat animals - it's not good for them and they don't like it"
: Can u just tell me in which file the data is stored
/system/apps/YOUR_APP/YOUR_APP.ini
Greg
--
Greg Roach, Stony Stratford, Bucks, England, greg@subaqua.co.uk
"Don't eat animals - it's not good for them and they don't like it"
Doesn't this save your data to the system ini file?! That's supposed to be banned (see KB at Symbiandevnet).
Instead you should open the ini file using CEikApplication::OpenIniFileLC.
Forum posts: 17
: banned (see KB at Symbiandevnet).
You are right - it does save it as a stream in the system.ini file.
For ER5, this was the prefered technique. IIRC, this is how the Word
application does it (source code was supplied with the SDK).
I don't remember for ER6.0, but I think it was still allowed then.
: Instead you should open the ini file using CEikApplication::OpenIniFileLC.
For ER6.1, the functionality was removed from CAknAppUi, so you need
to use CEikAppUi to get it.
For ER7.0 it is there again.
So, it may/may not be the preferred technique, depending on what
platform you are using.
I use it on all platforms, but only to save 16 bytes of data (registration code
and GUI prefs). It is not the place to store large amounts of data. This
would need to go into a application specific config file.
Greg
Forum posts: 112
Bye,
Gábor