PutFaxOnQueue

#include ”faxcpp.h”

int far PutFaxOnQueue(FAXOBJ Fax)

Class 1.

Class 2.

Class 2.0

Brooktrout

 

GammaLink

 

Dialogic

 

NMS

 

g

g

g

g

g

g

Description

This function puts the specified fax in the send queue. The specified fax will be automatically sent by the FAX C++ Manager on the first available port once all of the faxes in front of the specified fax have been sent.

Parameters

FAXOBJ

Fax

Fax object.

Return Value

Returns zero on success, otherwise returns an error code.


Sample Code

TSFaxParam  sFaxParam;

CImgApp *pApp = (CImgApp *)AfxGetApp();

 

if(pApp->FaxPorts[0]) {

            sFaxParam.PageNum = 1;

            sFaxParam.Resolut = RES_98LPI;

            sFaxParam.Width = PWD_NOCHANGE;

            sFaxParam.Length = PLN_NOCHANGE;

            sFaxParam.Compress = DCF_1DMH;

            sFaxParam.Binary = BFT_NOCHANGE;

            sFaxParam.BitOrder = BTO_FIRST_LSB;

            // Get remote fax number.

            GetDlgItemText(IDC_FAXNUMBER, sFaxParam.RemoteID, sizeof(sFaxParam.RemoteID));

            sFaxParam.Send = TRUE;

           

            FAXOBJ foFax = CreateSendFax('N', &sFaxParam );

            if(!foFax) {

                        // Creating fax is failed

            } else {

                        union TUFaxImage        sFaxPage;

                                  

                        sFaxPage.Dib = pDoc->hDib;

                        if(!SetFaxImagePage(foFax, 0, IMT_MEM_DIB, &sFaxPage,  0)) {

                                    // Get our identification string.

                                    CString cId = pApp->GetProfileString("Fax", "Identification String", NULL);

                                    char     szBuffer[80];

                                    strncpy(szBuffer, cId, sizeof(szBuffer));

                                    SetMyID(szBuffer);

                                    if(bSendQueue) {

                                                if(PutFaxOnQueue(foFax)) {

                                                            // Put fax into the queue has failed.

                                                }

                                    } else if(SendFaxNow(pApp->FaxPorts[0], foFax, FALSE)) {

                                                // Sending fax immediate has failed.

                                    } 

                        }  else {

                                    // Setting the image page has failed.

                        }

            }

} else {

            // No port is opened.

}