CL_MAIN.C
上传用户:bjghjy
上传日期:2007-01-07
资源大小:379k
文件大小:5k
- #include <windows.h>
- #include <string.h>
- #include <time.h>
- #include <stdlib.h>
- #include "main.h"
- #include "resource.h"
- #include "hq.h"
- #include "sv_hq.h"
- #include "data.h"
- #include "cl_hq.h"
- #include "cl_data.h"
- #include "cl_main.h"
- BOOL fAuto =TRUE;
- BOOL IsClectRun =FALSE;
- HANDLE hThrdClect =NULL;
- extern BOOL run_cancelled;
- BOOL clAppInit(void)
- {
- if(clHqInit() <0)
- {
- ErrMsg(NULL, "HqInit() failed!");
- return FALSE;
- }
- return TRUE;
- }
- void clAppExit(void)
- {
- static BOOL fExit =FALSE;
-
- if(fExit) return;
- fExit =TRUE;
-
- clHqExit();
- }
- BOOL clGetInitString(char *Entry, char *Item, char *buf)
- {
- GetPrivateProfileString(Entry, Item, "", buf, 256, "sv_data.ini");
- if(*buf ==0) return FALSE;
- return TRUE;
- }
- void clPutInitString(char *Entry, char *Item, char *buf)
- {
- WritePrivateProfileString(Entry, Item, buf, "sv_data.ini");
- }
- int clGetInitInt(char *Entry, char *Item)
- {
- return GetPrivateProfileInt(Entry, Item, -1, "sv_data.ini");
- }
- extern int date_num;
- extern int tim;
- long tim_seconds =0;
- int clCheckTime(BOOL fRead)
- {
- char tmp[40], tmp1[41];
- LPSTR tok;
- int jys, ret;
- static long time_start =-1;
- //struct tm *ptm;
-
- //HFILE hFile;
- //OFSTRUCT os;
- _strdate(tmp);
- date_num =100*atoi(strtok(tmp, "/"));
- tok =strtok(NULL, "/");
- date_num +=atoi(tok);
-
- _strtime(tmp); //hh:mm:ss
- strcpy(tmp1, tmp);
- tok =strtok(tmp, ":");
- tim =atoi(tok)*60;
- tim +=atoi(strtok(NULL, ":"));
- tim_seconds =(long)tim*60+atoi(strtok(NULL, ":"));
-
- if(time_start ==-1) time_start =tim_seconds;
- else if(tim_seconds >time_start)
- MsgLocal(tmp1);
-
- for(jys =0; jys <2; jys++)
- {
- //此处收市放量五分钟