TCBinaryParam enum

This enum type is used by the WriteValue() and ReadValue() member functions to define optional file attributes

BFD_filename

BFD_application_reference

BFD_machine

BFD_environment

BFD_pathname

BFD_user_visible_string

BFD_compression

These parameters may contain more than one string. Each string has a terminating zero byte and the last string has two terminating zero bytes.

 

BFD_permitted_actions

Integer number (2 byte). Possible value see: TEBftAction

 

BFD_date_and_time_last_modification

BFD_identity_of_last_modifier

This parameter may contain only one string  as generalized time format

1995 may 25   18:54  -  “9505251854”

 

BFD_filesize

Integer number (4 byte.)

 

BFD_private_use

Binary Data.  Use any application to transfer private data .

            Set BFD_application_reference  string to validate this binary data.

           

BFD_data_file_content_FILE

This parameter contains the file name of the binary data in file.

 

BFD_data_file_content_BINARY

This parameter points to the binary data in memory.

 

Only one parameter BFD_data_file_content_FILE or BFD_data_file_content_BINARY    required .

 

 


Sample code to  encode binary file  “C:\\DOS\\COMMAND.COM”

 

{

FAXOBJ faxobj  ;

union TUFaxImage    sFaxPage;

TCBinaryParam                   BftObj;   

char                             szBuffer[256] ;

              

    sFaxParam.PageNum           = 1 ;

    sFaxParam.Binary    = BFT_ENABLE;

    sFaxParam.BitOrder             = BTO_FIRST_LSB;

    sFaxParam.Send      = TRUE;

    sFaxParam.DeleteFiles = TRUE ;

           

    faxobj = CreateSendFax(REGTYPE_BINARYFILE, &sFaxParam);

  

   //  Required parameter

    memset(szBuffer,0,sizeof(szBuffer));           

    strcpy(szBuffer,”C:\\DOS\\COMMAND.COM”);

    BftObj.WriteValue(BFD_data_file_content_FILE, szBuffer,  strlen(szBuffer)+1);

           

    // This parameter optional                    

    memset(szBuffer,0,sizeof(szBuffer));           

    strcpy(szBuffer,”COMMAND.COM”);

    BftObj.WriteValue(BFD_filename, (LPBYTE)szBuffer,    strlen(szBuffer)+1 );

 

 

     sFaxPage.BftObj = &BftObj;

           

     SetFaxImagePage(FaxObj, 0 , IMT_BFTOBJ, &sFaxPage,  0);

}

 

 

Decoding this BFT File

 

{

   union TUFaxImage    sFaxPage;

   FAXOBJ                   FaxObj ;

   TCBinaryParam         BftObj;  

   long                             lSize ;

   char                                BftFileName[256] ;

                       

  sFaxPage.BftObj = &BftObj;

  GetFaxImagePage(FaxObj, 0,IMT_BFTOBJ, &sFaxPage, FALSE );

                                    GetTempFileName(0, "", 0, BfdFileName);

  // Read the filename if exist

  if (BftObj.ReadValue(BFT_filename, BftFileName, sizeof(BftFileName)) <=0  ) {

             strcpy(BftFileName,”C:\\TMP\\COMMAND.COM” );

  }

 

 //   Copy binary file data to specified file in BftFileName

  lSize = BftObj.ReadValue(BFD_data_file_content_FILE, (LPBYTE)BftFileName,        sizeof(BftFileName)+1);

}