You Are Here:

Community: Developer Discussion Boards

#1 Old Error sending file - 2003-11-05, 16:56

Join Date: Nov 2003
Posts: 6
maina1976
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia