I installed the program on the mobile but it comes to a part of a code that i read a file using ReadInt16 but it closes the application without any exeptions just exits.
any idea.
I installed the program on the mobile but it comes to a part of a code that i read a file using ReadInt16 but it closes the application without any exeptions just exits.
any idea.
Ali Khairat
OK I used it but it gave me exeption
Application closed KERN-EXEC 3
I know that it doesn't read an audio file maybe there is somethingwron when dealing with the audio file?
I copy it in the package file
So is this write or??Code:"..\data\SpeechFile.aud" -"!:\private\A35E2008\SpeechFile.aud"
Can I debug my code on the mobile device?? How?
Ali Khairat
Hi,
Have u checked whether the file is existing at that location before opening the file ( use BaflUtils FileExists())
KERN-EXEC 3 is for access violation.
Please paste your code where u r trying to open and read the file so that some one can help you .
Regards,
sudhakar
Regards,
Sudhakar
Ok you were right File doesn't exist.
Here is the code if it could help.
in the class constructor i initialize the file name.Code:ConstructL() { // Get a handle to the RFs session to be used (owned by CEikonEnv, NOT to be closed // when this application exits!) iFs = CEikonEnv::Static()->FsSession(); User::LeaveIfError( iFs.CreatePrivatePath( EDriveC ) ); User::LeaveIfError( iFs.SetSessionToPrivate( EDriveC ) ); }
I am using the code from AudioStream example.Code:RFileReadStream audiofile; //read data from this file // open file to read from TFileName fileName; fileNamei.Copy(iFilePath); fileNamei.Append(iFileName); TInt err = audiofile.Open(iFs, fileName, EFileRead&EFileStream);
Ali Khairat
Yes, you can debug on target. You don't mention which phone you're working with, but debug prints are always an option.
Mobile Sputnik: http://ptrmobile.blogspot.com/
Hi,
File not Existing! I( believe u checked with BaflUtils FileExists()) Then Opening non-existing file is nothing but access violation.
Regards,
Sudhakar
Regards,
Sudhakar
KERN-EXEC 3s on hardware but not on the emulator are in general indicative that you've overflowed the stack. If you're using large stack based buffers, then you might want to make them heap based.
Get Resolvr - The Zeroconf framework for Symbian OS free today. Make your IP networking applications fun and easy to use. http://www.novelinteractions.com/resolvr/
Proud to be the only autorickshaw owner in Cambridge - http://blog.novelinteractions.com/images/tuktuk.jpg
seems a bit suspicious to me (I would not rely on operator= of R-classes).Code:iFs = CEikonEnv::Static()->FsSession();
You can try having a reference, and initialize it in the constructor:or use local reference variables:Code:// .h RFs &iFs; // .cpp CYourClass::CYourClass() :iFs(CEikonEnv::Static()->FsSession()) { }you can also open files with this 'local' RFs, since it is not local, it is just an abbreviation for the RFs of CONE.Code:RFs &fs = CEikonEnv::Static()->FsSession(); ... User::LeaveIfError( fs.CreatePrivatePath( EDriveC ) );
So the key is using references in both cases.
And a small troublemaker:Should be | instead. In fact both constants are 0, so and-ing them makes no problem, but the general approach is to use or.Code:TInt err = audiofile.Open(iFs, fileName, EFileRead&EFileStream);
OK first for debuging i am using nokia E60
second I changed the code it is now.
Code:TInt err = audiofile.Open(iFs, fileName, EFileRead&EFileStream);I don't understand what do you mean by LocalCode:// .cpp CYourClass::CYourClass() :iFs(CEikonEnv::Static()->FsSession())
Ali Khairat
I put it in quotes, since it is not really local.
I meant that something likeis valid, since fs in OpenOrCreateFileL is not a local variable, thus the supplied File Server session remains valid all the time.Code:// .h RFile iFile; // .cpp void CYourClass::OpenOrCreateFileL() { RFs &fs = CEikonEnv::Static()->FsSession(); if ( iFile.Open(fs,KFileName,EFileWrite) != KErrNone ) User::LeaveIfError ( iFile.Replace(fs,KFileName,0) ); } void CYourClass::WriteL(const TDesC& aDesC) { HBufC8 *buf8 = HBufC8::NewLC(aDesC.Length()); buf8->Des().Copy(aDesC); User::LeaveIfError ( iFile.Write(*buf8) ); CleanupStack::PopAndDestroy(); }
I guess you have already known that, so it does not really matter.
so if i initials the rfs session in the constructor i should also initials the files in it or make a function and call it from the constructor because i have a lot of files and i use the same iFs to open all of them.
Another thing how does it work on the emulater and not on the mobile?
Last edited by alikhairat; 2007-07-31 at 11:47.
Ali Khairat
Also I was wondering how to debug it on the device.
It is Nokia E60 and I am working on carbide express v1.1 S60 3rd Edition sdk
Ali Khairat
Ok after some debuging i found out that the file was not even saved.
In example audiostream i call method record then saveaudiofile is it the problem.
Ali Khairat
Hi alikhairat,
If file is not saved means file is not available so reading non existing file will throw exceptions.
First work on the saving of recorded file which should automatically solve your issue.
Regards,
Sudhakar
Regards,
Sudhakar