

by ElectraSoft

About: FaxMail Network for Windows
FaxMail Network for Windows is popular with oil companies because it handles downhole well log image faxing.
Imagine being able to sit down at your computer in the morning and use it just as you would on a regular day, knowing that it is sending faxes for everyone in your entire office.
Now, this is a reality with FaxMail Network for Windows.
Let me show you just how it works...
FaxMail Network for Windows Readme, Upgrades
FaxMail Network for Windows Tutorial
FaxMail Network for Windows Screen Shots
FaxMail Network for Windows Manual, Fax API
Run FaxMail Network for Windows as an NT Service
FaxMail Network for Windows Installation
Frequently Asked Questions
FaxMail Network for Windows Q and AYou will need to create a comma delimited file called: ?:\faxmailn\data\DocToFax.del Where the ? is the drive that you installed FaxMail Network for Windows on. The DocToFax.del file can have as many lines in it as you want. One for each recipient. Code example: LOOP: o CREATE the ?:\faxmailn\data\DocToFax.del file o Copy document into ?:\faxmailn\data\DocToFax o WAIT until FaxMail Network for Windows deletes document from ?:\faxmailn\data\DocToFax o If done EXIT else back to LOOP EXIT:Method 2:
You will need to create a comma delimited file called: ?:\faxmailn\send2fax.del Where the ? is the drive that you installed FaxMail Network for Windows on. The send2fax.del file can have as many lines in it as you want. One for each recipient. DocToFax.del and send2fax.del Format: 3, 5 or 6 field comma delimited file with the following format: "Y/N(header at top of fax)","Recipient","FaxNumber" or: "Y/N(header at top of fax)","Recipient","FaxNumber","Scheduled Date", "Scheduled Time" or: "Y/N(header at top of fax)","Recipient","FaxNumber","Scheduled Date", "Scheduled Time","Subject" HeaderYN: A 1 character field consisting of either Y or N Recipient: A 31 character field consisting of the Recipient FaxNumber: A 46 character field consisting of a Fax Number The next 2 fields are optional... Scheduled Date: A 10 character field consisting of the day to send the Fax Scheduled Time: A 10 character field consisting of the time to send the Fax Example: "Y","Jon Krahmer","1-281-499-5939" or: "Y","Jon Krahmer","1-281-499-5939","07-15-2002","10:30:00am" or: "Y","Jon Krahmer","1-281-499-5939","07-15-2001","10:30:00am","Subject" FaxMail Network for Windows must be running in the background. The ?:\faxmailn\send2fax.del file must be create in the FaxMail directory. Print to the ElectraSoft Print to Fax. The ElectraSoft Print to Fax will create a ?:\esfax\fax file. FaxMail will see this file, convert it to a fax and call the Send Fax box. The Send Fax will see the ?:\faxmailn\send2fax.del file and instead of it's normal routine, it will work invisibly to send the fax as per the ?:\faxmailn\send2fax.del file and then delete ?:\faxmailn\send2fax.del. The next time you load the Send Fax box, it will work as normal. Code example: LOOP: o CREATE the send2fax.del file o PRINT document to: ElectraSoft Print to Fax o WAIT until FaxMail Network for Windows deletes send2fax.del o If done EXIT else back to LOOP EXIT: //============================== StartData ============================== char szStr1024[1024]; char szSend2Fax_Del[]={ "c:\\faxmailn\\send2fax.del"}; char szFaxToThisRecipient1[1024]= { "\"Y\",\"ElectraSoft\",\"1-281-499-5939\"" }; char szFaxToThisRecipient2[1024]= { "\"Y\",\"ElectraSoft\",\"1-281-499-5939\",\"2001-06-15\",\"10:30:00am\"" }; char szFaxToThisRecipient3[1024]= { "\"Y\",\"ElectraSoft\",\"1-281-499-5939\",\"2001-06-15\",\"10:30:00am\"",\"Subject\"" }; int iNumOfDocsToFaxToThisRecipient=3; //=============================== EndData =============================== //=========================== StartPrototypes =========================== void MyProgramsFaxProc(void); BOOL PrintTheseDocsToElectraSoftPrintToFax(int iNumOfPrintJobs, char* pszFaxToThisRecipient); BOOL PrintJobToElectraSoftPrintToFax(int iJob); BOOL WaitForElectraSoftPrintToFax(void); BOOL CreateSend2Fax_Del(char *pszFaxToThisRecipient); void DelayMs(DWORD dwMs); //============================ EndPrototypes ============================= //============================== StartCode =============================== //====================================================================== //| Example of what a call to PrintTheseDocsToElectraSoftPrintToFax may //| look like. //====================================================================== void MyProgramsFaxProc(void) { char szErrorMessageCption[]= { "MyProgramsFaxProc return value" }; char szReturnedFalse[]= { "MyProgramsFaxProc returned FALSE" }; char szReturnedTrue[]= { "MyProgramsFaxProc returned TRUE" }; //====================================================================== //| Remove comments and replace with your application specific //| source-code. //====================================================================== //Init MyProgramsFaxProc() and get set vars. if(PrintTheseDocsToElectraSoftPrintToFax( iNumOfDocsToFaxToThisRecipient, szFaxToThisRecipient1)==TRUE) { ::MessageBox(GetForegroundWindow(),szReturnedTrue, szErrorMessageCption,MB_ICONSTOP|MB_OK); } else { ::MessageBox(GetForegroundWindow(),szReturnedFalse, szErrorMessageCption,MB_ICONSTOP|MB_OK); } } //======================================================================== //| BOOL PrintTheseDocsToElectraSoftPrintToFax(int iNumOfPrintJobs, //| char* pszFaxToThisRecipient); //|=--------------------------------------------------------------------= //| BOOL PrintTheseDocsToElectraSoftPrintToFax(int iNumOfPrintJobs, //| char* pszFaxToThisRecipient); //| will send(put in SendQueue) 1 or more documents to //| pszFaxToThisRecipient. //| //| In this example, the FaxNumber is hard-coded to szFaxToThisRecipient1. //| //| You, as a programmer, will replace szFaxToThisRecipient1 with a //| variable. If sending 1 or more documents to a list of 1 or more //| FaxNumbers, incrementally set szFaxToThisRecipient1 to a different //| FaxNumber in the list, and call PrintTheseDocsToElectraSoftPrintToFax //| once for each FaxNumber that you want to send the fax/faxes to. //======================================================================== BOOL PrintTheseDocsToElectraSoftPrintToFax(int iNumOfPrintJobs, char* pszFaxToThisRecipient) { BOOL bRet=TRUE; //==================================================================== //| LOOP //==================================================================== for(int iJob=1;iJob<=iNumOfPrintJobs;iJob++) { //==================================================================== //| CREATE the send2fax.del file //==================================================================== if(CreateSend2Fax_Del(pszFaxToThisRecipient)==FALSE) { bRet=FALSE; break; } //==================================================================== //| PRINT document to: ElectraSoft Print to Fax //==================================================================== if(PrintJobToElectraSoftPrintToFax(iJob)==FALSE) { bRet=FALSE; break; } //==================================================================== //| WAIT until FaxMail Network for Windows deletes send2fax.del //==================================================================== if(WaitForElectraSoftPrintToFax()==FALSE) { bRet=FALSE; break; } //==================================================================== //| If done EXIT else back to LOOP //==================================================================== }//End------for(int iJob=1;iJob<=iNumOfPrintJobs;iJob++) //==================================================================== //| EXIT //==================================================================== return(bRet); } BOOL CreateSend2Fax_Del(char *pszFaxToThisRecipient) { int iSend2Fax_Del; if((iSend2Fax_Del=_open(szSend2Fax_Del,_O_CREAT|_O_TRUNC|_O_BINARY|_O_RDWR,_S_IREAD|_S_IWRITE)) < 0) { sprintf(szStr1024,"Could not create:\n" "%s" ,szSend2Fax_Del); ::MessageBox(GetForegroundWindow(), szStr1024,szAppsMsgCaption,MB_OK | MB_ICONSTOP); return(FALSE); } if(_write(iSend2Fax_Del,pszFaxToThisRecipient, (WORD)strlen(pszFaxToThisRecipient)) != (int)strlen(pszFaxToThisRecipient)) { _close(iSend2Fax_Del); return(FALSE); } _close(iSend2Fax_Del); return(TRUE); } BOOL PrintJobToElectraSoftPrintToFax(int iJob) { //====================================================================== //| Remove comments and replace with your application specific //| source-code. //====================================================================== //if(Your Print Routine Fails) //{ // return(FALSE); //} return(TRUE); } BOOL WaitForElectraSoftPrintToFax(void) { for(int iWait=0;;iWait++) { if(_access(szSend2Fax_Del,0)!=0) { break; } //=============================================================== //| 100 ms X 300 loops == 30000 ms == 30 seconds to time-out. //=============================================================== DelayMs(100); if(iWait==300) { if(::MessageBox(GetForegroundWindow(), "Last print job not done." ,"Apps Caption" ,MB_DEFBUTTON1|MB_ICONQUESTION|MB_RETRYCANCEL)==IDCANCEL) { return(FALSE); } iWait=0; } } return(TRUE); } void DelayMs(DWORD dwMs) { MSG msg; struct _timeb timebCurTime; DWORD dwCurTime,dwStopTime,dwSleepTime; dwSleepTime=(dwMs/10); if(dwSleepTime<1) dwSleepTime = 1; if(dwSleepTime>100) dwSleepTime = 100; _ftime(&timebCurTime); dwStopTime=(((timebCurTime.time * 1000) + timebCurTime.millitm) + dwMs); do { Sleep(dwSleepTime); if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)!=FALSE) { TranslateMessage(&msg); DispatchMessage(&msg); } _ftime(&timebCurTime); dwCurTime=((timebCurTime.time*1000) + timebCurTime.millitm); if(iTimeChangeFg>0) { --iTimeChangeFg; break; } }while(dwCurTime < dwStopTime); } //=============================== EndCode ================================
You are viewing a mobilized version of this site...
View original page here