I am trying to run my application on different devices i.e. N-Gage/3650/6600. Below given code is giving unexpected results.
If I make a call to below given code with in the constructor just after creating an object for CMdaAudioRecorderUtility.
It compiles and linked well and works fine on all devices.
But if I create just an object for CMdaAudioRecorderUtility in constructor and write below given code in a public function
and make a call for that function from somewhere else it give unexpected result. Code get Compiled and linked cleanly with NO
ERROR. If I run my application over Nokia 6600 it works fine but if I run it over Nokia N-GAge/3650 while executing below
code application closes.
// on emulator, the sound files used by application are deployed onto c: drive
// on real phone, application can be installed to the memory card (non-"C:" drive),
// this part of code evaluates current application path:
CEikonEnv& ee = *CEikonEnv::Static(); // find the instance of EikonEnv
CEikAppUi& ea = *(ee.EikAppUi()); // derive the instance of EikonAppUi
TFileName tAppFullName = ea.Application()->AppFullName(); // fetch the application full filename
parse.Set(tAppFullName, NULL, NULL); // form parse object containing full app name
TFileName tFullPath = parse.DriveAndPath(); // get application path with drive letter
parse.Set(tFullPath, &aFileName, NULL); // use tparse to get the full path to sound file
//parse.Set(aFileName,NULL, NULL); // use tparse to get the full path to sound file
TFileName tFullFileName = parse.FullName();
// Open an existing sample file for playback or recording,
// causes MMdaObjectStateChangeObserver::MoscoStateChangeEvent to be called