www.pudn.com > SMS PLAN.rar > func.h


#if !defined(FUNC_H) 
#define FUNC_H 
#include "stdafx.h" 
#define SMPPMAXLENGTH 512 
 
#define BIND			0x00000001 
#define BINDRESP		0x80000001 
#define UNBIND			0x00000002 
#define UNBINDRESP		0x80000002 
#define SUBMIT			0x00000004 
#define SUBMITRESP		0x80000004 
#define DELIVERY		0x00000005 
#define DELIVERYRESP	0x80000005 
#define QUERYSTATUS		0x00000006 
#define QUERYSTATUSRESP 0x80000006 
#define CANCEL			0x00000007 
#define CANCELRESP		0x80000007 
#define ALIVE			0x00000008 
#define ALIVERESP		0x80000008 
 
 
 
 
//Exit Code 
#define NOERROR 0 
#define ExitFromGetCallBack 1 
#define ExitFromLinkCallBack 2 
#define ExitFromInitDatabase 3 
#define ExitFromInit 4 
#define ExitFromSender 5    
#define ExitFromWSAStartup 6 
#define ExitFromWaitFailed 7 
#define ExitFromNetClose 8 
#define ExitFromDeliver 9 
#define ExitFromReceiver 10 
#define ISQL 1 
 
#define ONESECTION1 0 
#define ONESECTION2 0 
#define ONESECTION3 1 
#define MOBILELEN 20 
#define MSGLEN 140 
#define MSGLENP1 141 
#define TESTSMSC 0 
#define BADGW 1 
#define SPACE '\d' 
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile") 
inline void TESTHR(HRESULT x) {if FAILED(x) _com_issue_error(x);}; 
//#define COUNT2SEND 100 
#define COUNT2CHANGE 30 
#define COUNT2SMSC 20 
#define WITHDOG 0 
#define TESTCLIENT 0 
class CArg 
{ 
public: 
	BYTE isActive; 
	bool isDebug; 
	HANDLE hGW; 
	char	servicecode[20]; 
	_bstr_t strCnn; 
	char    SMSCCODE[20]; 
	char	ESMEID[10];//=EHOO11 
	char	ESMEPWD[16];//=ehoonet456 
	char	SMSCIP[20];//=10.0.0.170 
	short	SMSCPORT;//=9971 
	DWORD dwRet; 
	DWORD dwStationID; 
	SOCKET s; 
	BYTE nMaxLost,nMaxReconnect,nMaxInterval,nMaxResend; 
	char szManager[MOBILELEN+1]; 
#if ONESECTION1 
	CRITICAL_SECTION syc1; 
#endif 
#if ONESECTION2 
	CRITICAL_SECTION syc2; 
#endif 
#if ONESECTION3 
	CRITICAL_SECTION syc3; 
#endif 
}; 
 
 
void GetStamp(char*); 
int InitMsg(DWORD nCOMMANDID, 
			 char* buffer,			  
			 char* mobile, 
			 char* sm,DWORD id_time=0,DWORD id_sn=0,DWORD validate=10,DWORD state=0); 
 
 
void PutNByte(char* buffer,BYTE,DWORD); 
DWORD GetNByte(char* buffer,BYTE); 
 
void PutByteString(char* dest,char* source,int length); 
long Jstrcpy(char* dest,const char* source); 
long Jstrncpy(char* dest,const char* source,long size); 
int Jstrchr(const char*,char);   
bool GetArg(CArg*); 
char** AddSQL(char** ppStr,int index,char* str=NULL); 
DWORD WINAPI ReceiverMsg(LPVOID); 
DWORD WINAPI SenderMsg(LPVOID); 
DWORD WINAPI DeliverMsg(LPVOID); 
DWORD WINAPI ProNack(LPVOID); 
DWORD WINAPI GetMsgThread(LPVOID); 
DWORD WINAPI Exec(LPVOID pp); 
DWORD WINAPI ExecM(LPVOID pp); 
int TranState(char*); 
DWORD GetTime(); 
void GetLastday(char* buffer); 
void AddBinLog(char*,int); 
#ifdef __cplusplus 
extern "C" { 
#endif 
DWORD testfun(); 
#ifdef __cplusplus 
} 
#endif 
 
 
void testfun2(SOCKET); 
GW_API DWORD BeginGW(LPVOID); 
#endif