⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smarfaxh.h

📁 一个非常实用的用于开发Fax的modem程序
💻 H
📖 第 1 页 / 共 2 页
字号:








/**********************************************************************************
函数名:<_TapiSmartSendFax>
----------------------------
功能:			通过TAPI接口发送传真!
----------------------------
参数:
	1:	hFax			传真对象句柄	
	2:	hCall			传真参数
	3:	hline			传真参数
	4:	FileName		传真文件名
	5:	Identifi		传真识别符(一般添入自己的传真号码)
	6:	Volume			Modem应答音量( 0 | 1 | 2 | 3 )
	7:	Speed			传真需要的速度( 24 | 48 | 72 | 96 | 120 |144) 
	8:	Class			传真类型(CLASS_1 | CLASS_2 | CLASS_1.0 | CLASS_2.0)
	9:	Is2d			压缩方式(U2D_ENABLE | U2D_DISABLE) 
	10: ECM				纠错方式(ECM_ENABLE | ECM_DISABLE )
	11: CreateHead		建立传真页眉信息
	12: Resolution		传真质量
	13: From			发送者
	14: To				接受者
	15: hWnd			消息窗口句柄
	16: Msg				消息ID (WM_SMARTFAX)

返回值:
  
	0:	    End if function completes successfully
	-1:     Exception error	
	101:    Failed to Open FAX file ~
	102:    Couldn't conneced  within 35 secs of ATA command
	103:	Resevr
	104:    Failed to send CSI frames 
	105:    Failed to send DIS frames 
	106:    Failed to send NFS frames 
	107:    Failed to send other negotiating frames
	108:    Failed to send CFR frames
	109:    Failed to training
	110:    Failed to send FTT frames
	111:    Failed to set training speed  3 times
	112:    Failed to send CRP frames
	113:    Failed to dropped carrier within 5 s 
	114:    Failed to respond to +FRM properly
	115:    Failed to get modem data
	116:    Failed to accept page data
  	201:	Couldn't be found transmit file 
	202:	Transmit file isn't TIFF CLASS
	203:	Call isn't answered within 30 s
	204:	Machine can't receive fax data
	205:	Couldn't set +FTM
	206:	Couldn't set +FTM
	210:	NO DIALTONE
	211:	BUSY
	212:	NO ANSWER
	213:	NO CARRIER

	
************************************************************************************/

int _TapiSmartSendFax(SmartFaxObj *hFax ,HCALL &hCall,HLINE &hline,const char *Tel,const char *FileName,
					  const char *Identifi,EVolume Volume ,EFaxSpeed Speed,EClass Class,EUsed2D Is2d,
					  EErrorCorrect ECM,ECreateHead CreateHead,EResolution Resolution,
					  const char * From ,const char * Receiver,HWND hWnd,UINT Msg,int nStartPage);




/**********************************************************************************
函数名:	<SmartReceiveFax>
----------------------------
功能:	直接通过端口接收传真
----------------------------
参数:
	1: FaxParam		传真参数 (见SFaxParam定义)		
	
************************************************************************************/

int SmartReceiveFax(SFaxParam *FaxParam);




/**********************************************************************************
函数名:<_SmartReceiveFax>
----------------------------
功能:	直接通过端口接收传真
----------------------------
参数:
	1:	hFax			传真对象句柄	
	2:	nPort			端口号	
	3:	FileName		传真文件名
	4:	Identifi		传真识别符(一般添入自己的传真号码)
	5:	Volume			Modem应答音量( 0 | 1 | 2 | 3 )
	6:	Speed			传真需要的速度( 24 | 48 | 72 | 96 | 120 |144) 
	7:	Class			传真类型(CLASS_1 | CLASS_2 | CLASS_1.0 | CLASS_2.0)
	8:	Is2d			压缩方式(U2D_ENABLE | U2D_DISABLE) 
	9:  ECM				纠错方式(ECM_ENABLE | ECM_DISABLE )	
	10: hWnd			消息窗口句柄
	11: Msg				消息ID (WM_SMARTFAX)
	
************************************************************************************/

int _SmartReceiveFax(SmartFaxObj *hFax  ,unsigned char nPort  ,const char *FaxFileName , 
					 const char *Identifi,EVolume Volume = VO_LOW,  EFaxSpeed Speed =FS_1440,					 
					 EClass Class = CLASS_1 ,EUsed2D Is2d = U2D_ENABLE ,EErrorCorrect ECM = ECM_ENABLE,
					 HWND hWnd = NULL ,UINT Msg = NULL);



/**********************************************************************************
函数名:_SmartReceiveFax
功能:接收传真文件
参数:
	1: nPort		端口号	
	2: FaxFileName	传真文件名
	3: Identifi     传真识别符(一般添入自己的传真号码)
	4: Speed		传真需要的速度(default 96) 
	5: Fclass		CLASS TYPE (defualt Class 1)
	6: Twodee		压缩方式(0 - 1D,1 - 2D defaul 1 ) 
	7: ECM			纠错方式(defaul 1)
	8: hWnd			接受传真消息的窗口句柄
	9: Msg			传真消息

返回值:

    0:	    End if function completes successfully
	-1:     Exception error	
	101:    Failed to Open FAX file ~
	102:    Couldn't conneced  within 35 secs of ATA command
	103:	Resevr
	104:    Failed to send CSI frames 
	105:    Failed to send DIS frames 
	106:    Failed to send NFS frames 
	107:    Failed to send other negotiating frames
	108:    Failed to send CFR frames
	109:    Failed to training
	110:    Failed to send FTT frames
	111:    Failed to set training speed  3 times
	112:    Failed to send CRP frames
	113:    Failed to dropped carrier within 5 s 
	114:    Failed to respond to +FRM properly
	115:    Failed to get modem data
	116:    Failed to accept page data
  	201:	Couldn't be found transmit file 
	202:	Transmit file isn't TIFF CLASS
	203:	Call isn't answered within 30 s
	204:	Machine can't receive fax data
	205:	Couldn't set +FTM
	206:	Couldn't set +FTM
	210:	NO DIALTONE
	211:	BUSY
	212:	NO ANSWER
	213:	NO CARRIER


*******************************************************************************/






/**********************************************************************************
函数名:	<SmartSendFax>
----------------------------
功能:	直接通过端口接收传真
----------------------------
参数:
	1: FaxParam		传真参数 (见SFaxParam定义)		
	
************************************************************************************/
int SmartSendFax(SFaxParam *FaxParam);



/**********************************************************************************
函数名:<_SmartSendFax>
----------------------------
功能:	直接通过端口发送传真
----------------------------
参数:
	1:	hFax			传真对象句柄	
	2:	nPort			端口号		
	3:	FileName		传真文件名
	4:	Identifi		传真识别符(一般添入自己的传真号码)
	5:	Volume			Modem应答音量( 0 | 1 | 2 | 3 )
	6:	Speed			传真需要的速度( 24 | 48 | 72 | 96 | 120 |144) 
	7:	Class			传真类型(CLASS_1 | CLASS_2 | CLASS_1.0 | CLASS_2.0)
	8:	Is2d			压缩方式(U2D_ENABLE | U2D_DISABLE) 
	9:  ECM				纠错方式(ECM_ENABLE | ECM_DISABLE )
	10: CreateHead		建立传真页眉信息
	11: Resolution		传真质量
	12: From			发送者
	13: To				接受者
	14: hWnd			消息窗口句柄
	15: Msg				消息ID (WM_SMARTFAX)

	
************************************************************************************/

int _SmartSendFax(SmartFaxObj *hFax ,unsigned char nPort,const char *Tel,
				  const char *FaxFileName, const char *Identifi,EVolume Volume ,EFaxSpeed Speed,
				  EUsed2D Is2d,EErrorCorrect ECM,ECreateHead CreateHead,EResolution Resolution,
				  const char * From ,const char * Receiver,HWND hWnd,UINT Msg,int nStartPage);

/**********************************************************************************
函数名:SmartSendFax
功能:发送传真文件
参数:
	1: nPort		端口号
	2: Tel			接受端号码
	3: FaxFileName	传真文件名
	4: Identifi     传真识别符(一般添入自己的传真号码)
	5: Speed		传真需要的速度(default 96) 
	6: Fclass		CLASS TYPE (defualt Class 1)
	7: Twodee		压缩方式(0 - 1D,1 - 2D defaul 1 ) 
	8: ECM			纠错方式(defaul 1)
	9: hWnd			接受传真消息的窗口句柄
	9: Msg			传真消息

返回值:

    0:	    End if function completes successfully
	-1:     Exception error	
	101:    Failed to Open FAX file ~
	102:    Couldn't conneced  within 35 secs of ATA command
	103:	Resevr
	104:    Failed to send CSI frames 
	105:    Failed to send DIS frames 
	106:    Failed to send NFS frames 
	107:    Failed to send other negotiating frames
	108:    Failed to send CFR frames
	109:    Failed to training
	110:    Failed to send FTT frames
	111:    Failed to set training speed  3 times
	112:    Failed to send CRP frames
	113:    Failed to dropped carrier within 5 s 
	114:    Failed to respond to +FRM properly
	115:    Failed to get modem data
	116:    Failed to accept page data
  	201:	Couldn't be found transmit file 
	202:	Transmit file isn't TIFF CLASS
	203:	Call isn't answered within 30 s
	204:	Machine can't receive fax data
	205:	Couldn't set +FTM
	206:	Couldn't set +FTM
	210:	NO DIALTONE
	211:	BUSY
	212:	NO ANSWER
	213:	NO CARRIER

*******************************************************************************/




	
// fax message for windows 

#define WM_SMARTFAX				WM_USER+101


#define WM_FAXMISSIONINOVER		0x101
#define WM_FAXCHANGESTATE		0x102
#define WM_FAXSETCIS			0x103
#define WM_FAXSETSPEED			0x104
#define WM_FAXMISSIONOUTOVER	0x105
#define WM_FAXRECVPAGEDATA		0x106
#define WM_FAXSENDPAGEDATA		0x107
#define WM_ACCEPTPAGE			0x108
#define WM_REJECTPAGE			0x109
#define WM_FAXSPEED				0x110
#define WM_FAXPROCESSPAGEDATA	0x111
#define WM_FAXUSERCANCE			0x112
#define WM_FAXECM				0x113
#define WM_FAXPAGE				0x114

#define WM_FAXRING				0x115

#define WM_FAXMONITORCLOSE		0x116
#define WM_FAXMONITORSTART		0x117
#define WM_FAXMONITORFAIL		0x118

#define WM_FAXANI				0x119


#define FAXINIT					0
#define DIALFAX					1
#define ANSWER					2
#define NEGOTIATION				3
#define TRAINING				4



/*

#ifdef  __cplusplus
}
#endif
*/














#endif //__SMARTFAX_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -