Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
This page was last modified 11:19, 12 December 2007.

Using CWriteFaxFile

From Forum Nokia Wiki


Similar to CReadFaxFile usage CWriteFaxFile also has three steps::

  • Creating and opening the file
  • Adding pages to the fax file
  • Committing pages to the file and closing the file

The following code snippet shows the usage:

//Create err variable and descriptors for panics while creating and opening file
TInt err;
_LIT(KFaxFileName, "c:\\file.fax");
_LIT(KPanicOpeningWriteFile,"Opening write file");
 
//Create scan line write buffer and set its size
TBuf8<216> scanlineWrite;
scanlineWrite.SetLength(216);
_LIT(KPanicAddScanLine,"Adding scanline");
TInt row, numberLines;
 
 
//Create and open fax file.If there is an error then panic
TRAP(err,writeFaxFile->OpenL(KFaxFileName,64));
if (err!=KErrNone)
    User::Panic(KPanicOpeningWriteFile,err);
 
//set the resolution as normal, and the encoding as MH
iWriteFaxPages->StartPage(EFaxNormal, EModifiedHuffman);
 
 
// iterate through the scan lines, adding them to the page
for (row=0; row<numberLines; row++)
{
    scanlineWrite[0] = TUint8(row);
    // create test scan line — for which the first byte is the current line number
    // add test scan line. Panic if there is an error adding line
    TRAP(err,writeFaxFile->iWriteFaxPages->AddScanLineL(scanlineWrite));
    if (err!=KErrNone)
        User::Panic(KPanicAddScanLine,err);
}
 
_LIT(KPanicEndingPage,"Ending page");
// call EndPageL() under a trap harness. Panic if error saving page information
TRAP(err,writeFaxFile->iWriteFaxPages->EndPageL(EFaxFine,senderId));
if (err!=KErrNone)
    User::Panic(KPanicEndingPage,err);
 
 
 
_LIT(KPanicCommittingPages,"Committing pages");
//Call CommitL() under a trap harness. Panic if error commiting page
TRAP(err,writeFaxFile->CommitL());
if (err!=KErrNone)
    User::Panic(KPanicCommittingPages,err);
 
writeFaxFile->Close();


Fax file storage can be aborted at any time using CWriteFaxFile::AbortWrite(). The function first aborts the storing operation, and then deletes the file. It can be called at any point prior to closing the file.

writeFaxFile->AbortWrite();


Links

Related Discussions

Thread Thread Starter Forum Replies Last Post
Fax Client API on Series 60 synov General Symbian C++ 2 2006-02-23 13:13
Fax API problem synov General Symbian C++ 0 2002-11-12 06:14

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia 
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX