| Reply | « Previous Thread | Next Thread » |
|
Hi all,
I try to send a file (locate on the nokia 3650) via bluetooth. I send this file from my nokia phone to the printer (connected by bluetooth adapter). The code that I implemented is: void CMessageClient::SendMessageL() { if (iState != EConnected) { User::Leave(KErrDisconnected); } // Stop reading socket iSendingSocket.CancelRead(); if (IsActive()) { Cancel(); } iState = ESendingMessage; fsSession.Connect(); _LIT(KStoreFileName, "C:\\testlog.txt"); TInt err1 = file.Open(fsSession, KStoreFileName, EFileRead); TInt escape(27); TInt E(69); if (err1==KErrNotFound){ // file does not exist iLog.LogL(_L("Error open file")); }else{ iLog.LogL(_L("Send File...")); TBuf8<1024> buffer; buffer.Zero(); do{ file.Read(buffer); //buffer.AppendNum(escape); //buffer.AppendNum(E); iSendingSocket.Write(buffer, iStatus); User::WaitForRequest(iStatus); }while(buffer.Length() != 0); file.Close(); iLog.LogL(_L("File Sent")); } fsSession.Close(); SetActive(); } I don't understand why when I send the file more than two time, the application crash! Somebody can help me? Thanks |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|