L
lijianzhou
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是在C中定义的头文件,请问如何转换成delphi,谢谢!<br><br>// ClientApi.h: interface for the USSD API routines.<br>//<br>#ifndef __CLIENT_API<br>#define __CLIENT_API<br><br>#define MAX_MSISDN_LENGTH 20<br>#define MAX_SERVICECODE_LENGTH 3<br>#define MAX_USSDSTRING_LENGTH 181<br><br>#define UT_REQUEST 1 // Request.<br>#define UT_NOTIFY 2 // Notify.<br>#define UT_RESPONSE 3 // Response.<br>#define UT_RELEASE 4 // Release.<br><br>#define UV_UNKNOWN 0x00 // 未知.<br>#define UV_PHASE_I 0x10 // Phase I (只能由移动台发起)<br>#define UV_PHASE_II 0x20 // Phase II<br>#define UV_PHASE_II_PLUS 0x25 // Phase II+<br><br>#define INVALID_INSTANCE_HANDLE ((HANDLE)-1)<br><br>struct TUssdSwitchInfo //业务转移信息<br>{<br> BYTE m_bSwitchMode;<br> char m_szMsIsdn[MAX_MSISDN_LENGTH + 1];<br> char m_szServiceCode[MAX_SERVICECODE_LENGTH + 1];<br> char m_szUssdString[MAX_USSDSTRING_LENGTH + 1];<br>};<br><br>struct TUssdChargeIndInfo //计费指示信息<br>{<br> DWORD m_dwChargeRatio;<br> DWORD m_dwChargeType;<br> char m_szChargeSource[MAX_MSISDN_LENGTH + 1];<br> BYTE m_bChargeLocation;<br>};<br><br>struct TUssdData<br>{<br> DWORD m_dwUssdCmd; // USSD会话操作类型(Request、Response、Abort、Error)<br> BYTE m_bUssdVersion; // USSD会话版本号(Phase I、Phase II、Phase II+)<br> BYTE m_bCodeScheme; //编码方案<br> DWORD m_dwErrorCode; // USSD错误代码(仅对UssdAbort和UssdError)<br> char m_szMsIsdn[MAX_MSISDN_LENGTH + 1]; // 移动台号码.<br> char m_szServiceCode[MAX_SERVICECODE_LENGTH + 1]; // 业务码.<br> char m_szUssdString[MAX_USSDSTRING_LENGTH + 1]; // USSD串内容。<br> DWORD m_dwUssdAppParam; // USSD业务应用程序自定义的参数。<br>};<br><br>//-----------------------------------------------------------------------------<br>// CallBack Functions For GetMessage<br>//------------------------------------------------------------------------------<br>typedef int (*LPONUSSDREQUEST)(HANDLE hLoginInstance, HANDLE hUssdDialog,<br> TUssdData UssdData, DWORD *pdwUssdAppParam);<br>typedef int (*LPONUSSDRESPONSE)(HANDLE hLoginInstance, HANDLE hUssdDialog, <br> char szUssdString[], DWORD dwUssdAppParam);<br>typedef int (*LPONUSSDABORT)(HANDLE hLoginInstance, HANDLE hUssdDialog, <br> DWORD dwErrorCode, DWORD dwUssdAppParam);<br>typedef int (*LPONUSSDERROR)(HANDLE hLoginInstance, HANDLE hUssdDialog, <br> DWORD dwErrorCode, DWORD dwUssdAppParam);<br>typedef int (*LPONUSSDTIMEOUT)(HANDLE hLoginInstance, HANDLE hUssdDialog, <br> DWORD dwUssdAppParam);<br><br>struct TUssdCallbacks<br>{<br> LPONUSSDREQUEST m_pOnUssdRequest;<br> LPONUSSDRESPONSE m_pOnUssdResponse;<br> LPONUSSDABORT m_pOnUssdAbort;<br> LPONUSSDERROR m_pOnUssdError;<br> LPONUSSDTIMEOUT m_pOnUssdTimeOut;<br>};<br> <br>extern "C" <br>{<br>int PASCAL EXPORT UssdInit(char szServerAddress[],int nServicePort);<br>int PASCAL EXPORT UssdExit();<br>HANDLE PASCAL EXPORT UssdLogin(char szAccountName[],char szPassword[],int *pnErrorCode,BOOL fAutoConnect,DWORD dwTimeOut);<br>BOOL PASCAL EXPORT UssdLogout(HANDLE hLoginInstance,int *pnErrorCode);<br>BOOL PASCAL EXPORT UssdIsConnectionOK(HANDLE hLoginInstance);<br>void PASCAL EXPORT UssdGetErrorString(int nErrorCode,char *pszErrorString);<br>BOOL PASCAL EXPORT UssdReloadErrorInfoLib();<br>HANDLE PASCAL EXPORT UssdLocalOpen(HANDLE hLoginInstance, DWORD dwUssdAppParam, DWORD *pdwErrorCode);<br>BOOL PASCAL EXPORT UssdLocalClose(HANDLE hUssdDialog);<br>int PASCAL EXPORT UssdSendRequest(HANDLE hUssdDialog, TUssdData UssdData);<br>int PASCAL EXPORT UssdSendNotify(HANDLE hUssdDialog, TUssdData UssdData);<br>int PASCAL EXPORT UssdSendResponse(HANDLE hUssdDialog, TUssdData UssdData);<br>int PASCAL EXPORT UssdSendRelease(HANDLE hUssdDialog);<br>int PASCAL EXPORT UssdSendAbort(HANDLE hUssdDialog, DWORD dwErrorCode);<br>int PASCAL EXPORT UssdSendError(HANDLE hUssdDialog, DWORD dwErrorCode);<br>int PASCAL EXPORT UssdSendSwitch(HANDLE hUssdDialog, TUssdSwitchInfo SwitchInfo);<br>int PASCAL EXPORT UssdSendChargeInd(HANDLE hUssdDialog, TUssdChargeIndInfo ChargeIndInfo);<br>int PASCAL EXPORT RegisterUssdCallbackFunctions(TUssdCallbacks CallbackFuncs);<br>};<br><br>#endif // __CLIENT_API defined.