| Reply | « Previous Thread | Next Thread » |
|
hi there,
i have a problem in sending a file over BT which i code in my apps. for information i use nokia 3660. when i send the file which size is 987KB, it goes OK, but i goes fail when the size of the file is 1.207MB. (both file are in drive E) what memory did the phone use? i have check it by using FExplorer and here is the information C<flash> 1.743MB free D<ram> 440.5KB free E<disk> 8.816MB free Z<rom> 0 free my questions are 1. how to send a file which size is big enough? can i partial it? (below i post some of the code) 2. how to capture when an error of memory full is showed? (the error pretty much looks like this MyApp: memory full. close some applications and try again.) my code: RFs fs; RFile file; fs.Connect(); file.Open(fs, aFileName, EFileRead); // Returns code checking removed to brevity TInt size; TUint8 *filedata; file.Size(size); filedata = new TUint8[size]; // read data TPtr8 ptr( filedata, size, size); file.Read(ptr); file.Close(); fs.Close(); // construct a CBufFlat and then an OBEX bufObject from it iBufFlat = CBufFlat::NewL(size); iBufFlat->SetReserveL(size); iBufFlat->InsertL(0, filedata, size); iCurrObject = CObexBufObject::NewL(iBufFlat); delete filedata; // Set the filename in the OBEX object TParse f; f.Set(aFileName,NULL,NULL); TBuf<256> name; name.Copy(f.NameAndExt()); iCurrObject->SetNameL(name); iClient->Put(*iCurrObject, iStatus); SetActive(); thanks in advance, Rx-lee
Last edited by Rx-lee : 2004-10-18 at 12:00.
|
|
How about...
.... iCurrObject = CObexFileObject::NewL(aFilename); iCurrObject->InitFromFileL(aFilename); iClient->Put(*iCurrObject, iStatus); ..... |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|