JY_CL.H
上传用户:bjghjy
上传日期:2007-01-07
资源大小:379k
文件大小:8k
- #define WM_JY_INIT WM_USER+20
- #define WM_JYCX_RES WM_USER+30
- #define WM_JY_RES WM_USER+40
- #define JY_CHKUSR_HEAD (LPSTR)"JYCHKUSR"
- #define JY_CHGPWD_HEAD (LPSTR)"JYCHGPWD"
- #define JY_BUYSELL_HEAD (LPSTR)"JYBUYSELL"
- #define JY_CANCEL_HEAD (LPSTR)"JYCANCEL"
- #define JY_YECX_HEAD (LPSTR)"JYYECX"
- #define JY_CJCX_HEAD (LPSTR)"JYCJCX"
- #define JY_WTCX_HEAD (LPSTR)"JYWTCX"
- #define JY_CXEND_HEAD (LPSTR)"JYCXEND"
- #define JY_TIMEOUT_HEAD (LPSTR)"JYTIMEOUT"
- #define JY_ZQSXX_HEAD (LPSTR)"PKRSA"
- #define MAX_GDDM_SIZE 10
- #define MAX_JYMM_SIZE 6
- #define MAX_RQ_SIZE 8
- #define MAX_GPDM_SIZE 6
- #define MAX_HTHM_SIZE 6
- #define MAX_TIME_SIZE 8
- #define MAX_JY_WAIT_TIME 35
- #define MAX_CANCEL_SENDCOUNT 2
- #define MAX_CX_SENDCOUNT 20
- #define MAX_ZQS_COUNT 32
- typedef struct tag_zqsxx
- {
- int zqsid[MAX_ZQS_COUNT +1];
- char zqsjc[MAX_ZQS_COUNT +1][12 +1];
- }ZQSXX, FAR *LPZQSXX;
- ///////// 检查用户和密码请求
- typedef struct tag_PACK_ASK_CHKUSR
- {
- char jys;
- int zqsid;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char jymm[MAX_JYMM_SIZE+1];
- int sdHq;
- }JY_ASK_CHKUSR, FAR *LPJY_ASK_CHKUSR;
- ////////// 检查用户和密码返回
- typedef struct tag_PACK_ANS_CHKUSR
- {
- char flag; //if 1,right,if 0 ,then user invalid
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CHKUSR, FAR *LPJY_ANS_CHKUSR;
- /////////// 2 修改密码请求
- typedef struct tag_PACK_ASK_CHGPWD
- {
- char jys; //
- long userId;
- char gddm[MAX_GDDM_SIZE+1]; //
- //char oldPwd[MAX_JYMM_SIZE+1];
- char newPwd[MAX_JYMM_SIZE+1]; //
- }JY_ASK_CHGPWD, FAR *LPJY_ASK_CHGPWD;
- ///////// 修改密码返回
- typedef struct tag_PACK_ANS_CHGPWD
- {
- char flag; // if 0 succeed,if -1 then failed
- char jys; //
- char gddm[MAX_GDDM_SIZE+1]; //
- }JY_ANS_CHGPWD, FAR *LPJY_ANS_CHGPWD;
-
- ///////// 3 买卖请求
- typedef struct tag_PACK_ASK_BUYSELL
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- char bs;
- long wtgs;
- long wtjg;
- }JY_ASK_BUYSELL, FAR *LPJY_ASK_BUYSELL;
- ///////// 买卖返回
- typedef struct tag_PACK_ANS_BUYSELL
- {
- char flag; //0 succeed,-1 no money,-2 no stock
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- char hthm[MAX_HTHM_SIZE+1];
- char bs;
- }JY_ANS_BUYSELL, FAR *LPJY_ANS_BUYSELL;
- ////////// 4 撤单请求
- typedef struct tag_CANCEL
- {
- char hthm[MAX_HTHM_SIZE+1];
- }CANCEL, FAR *LPCANCEL;
- typedef struct tag_PACK_ASK_CANCEL
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- int cancelCount;
- CANCEL Cancel[MAX_CANCEL_SENDCOUNT];
- }JY_ASK_CANCEL, FAR *LPJY_ASK_CANCEL;
- /////////// 4 撤单返回
- typedef struct tag_PACK_ANS_CANCEL
- {
- char flag[MAX_CANCEL_SENDCOUNT]; //0 succeed,-1 failed
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CANCEL, FAR *LPJY_ANS_CANCEL;
- ///////// 5 余额查询请求
- typedef struct tag_PACK_ASK_YECX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- }JY_ASK_YECX, FAR *LPJY_ASK_YECX;
- typedef struct tag_GPTG
- {
- char gpdm[MAX_GPDM_SIZE+1];
- char kys[12+1], gpye[12+1];
- char ghrq[MAX_RQ_SIZE+1];
- }JY_GPTG, FAR *LPJY_GPTG;
- ///////// 5 余额查询结果
- typedef struct tag_PACK_ANS_YECX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recCount;
- double kys, zjye;
- JY_GPTG GpTg[MAX_CX_SENDCOUNT];
- }JY_ANS_YECX, FAR *LPJY_ANS_YECX;
- /////// 6 成交查询
- typedef struct tag_PACK_ASK_CJCX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char cjrq[MAX_RQ_SIZE+1]; //YY:MM:DD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL CJ
- }JY_ASK_CJCX, FAR *LPJY_ASK_CJCX;
- typedef struct tag_CJ
- {
- char hthm[MAX_HTHM_SIZE+1]; //
- char cjsj[MAX_TIME_SIZE+1]; //HHMISS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char cjgs[12+1];
- char cjjg[12+1];
- }JY_CJ, FAR *LPJY_CJ;
- ////// 6 成交查询结果
- typedef struct tag_PACK_ANS_CJCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recCount;
- char cjrq[MAX_RQ_SIZE+1]; //YY:MM:DD
- JY_CJ Cj[MAX_CX_SENDCOUNT];
- }JY_ANS_CJCX, FAR *LPJY_ANS_CJCX;
- /////// 7 委托查询请求
- typedef struct tag_PACK_ASK_WTCX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1]; //
- char wtrq[MAX_RQ_SIZE+1]; //YY:MM:DD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL WT
- char cdcx;
- }JY_ASK_WTCX, FAR *LPJY_ASK_WTCX;
- typedef struct tag_WT
- {
- char hthm[MAX_GPDM_SIZE+1]; //
- char wtsj[MAX_TIME_SIZE+1]; //HHMISS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char wtgs[12+1]; //if wtgs<0 then is cancel
- char wtjg[12+1];
- }JY_WT, FAR *LPJY_WT;
- ///////// 7 委托查询结果
- typedef struct tag_PACK_ANS_WTCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recCount;
- char wtrq[MAX_RQ_SIZE+1]; //YYMMDD
- JY_WT Wt[MAX_CX_SENDCOUNT];
- }JY_ANS_WTCX, FAR *LPJY_ANS_WTCX;
-
- // defeine comm dbf file
- #define fld_ASKNO 0
- #define fld_ANSNO 1
- #define fld_STKNO 2
- #define fld_GDDM 3
- #define fld_JYMM 4
- #define fld_GPDM 5
- #define fld_WTGS 6
- #define fld_WTJG 7
- #define fld_HTHM 8
- #define fld_DATE 9
- #define fld_STAT 10
- #define REQ_NULL '0'
- #define REQ_CHKUSR '1'
- #define REQ_CHGPWD '2'
- #define REQ_BUY '3'
- #define REQ_SELL '4'
- #define REQ_CANCEL '5'
- #define REQ_YECX '6'
- #define REQ_CJCX '7'
- #define REQ_WTCX '8'
- #define ANS_SUCC '0'
- #define ANS_TIME_OUT 'A'
- #define ANS_SYS_ERR 'B'
- #define ANS_NO_PRIV 'C'
- #define ANS_NO_GDDM 'D'
- #define ANS_CANCEL_FAILE 'E'
- #define ANS_NO_DATA_FOUND 'F'
- #define ANS_GDDM_USE 'I'
- #define ANS_SUSP_REQ 'J'
- #define ANS_CX_END -50
- #define ANS_UNKOWN -100
- #define JY_FLAG_RESET -200
- #define MAX_WAIT_TIME 20
- void CenterWindow(HWND hDlg);
- void DrawFrame(HDC hDC, HWND hWnd);
- BOOL JyInit(void);
- void JyExit(void);
- void JyTimer(void);
- int Jy(void);
- int DlgJy(void);
- int DlgSelectJys(void);
- int DlgSelectZqs(void);
- int DlgChkUsr();
- int DlgChgPwd();
- int DlgBuySell(int bs);
- int DlgCancel();
- int DlgYecx();
- int DlgCjcx();
- int DlgWtcx();
- int InitQsInfo(void);
- int JyQs;
- char Addr[MAX_ZQS_COUNT][15];
- JY_ANS_CHKUSR curChkUsrRes;
- JY_ASK_CHKUSR curChkUsrData;
- HWND ghDlgJy;
- ZQSXX Qsxx;
- LRESULT CALLBACK SelJysDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK SelZqsDlgProc(HWND, UINT, WPARAM ,LPARAM);
- LRESULT CALLBACK ChkUsrDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK AskPwdDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK ChgPwdDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK JyDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK BuySellDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK CancelDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK YecxDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK WtcxDlgProc(HWND, UINT, WPARAM, LPARAM);
- LRESULT CALLBACK CjcxDlgProc(HWND, UINT, WPARAM, LPARAM);