懂C++请进来看看 ( 积分: 300 )

  • 主题发起人 主题发起人 illiperson
  • 开始时间 开始时间
I

illiperson

Unregistered / Unconfirmed
GUEST, unregistred user!
下面是用VC++编写的股票数据接口文件,哪位能将它转成delphi文件形式啊?
#ifndef __STOCKDRV_H__
#define __STOCKDRV_H__
#define RCV_WORK_SENDMSG 4
#define RCV_REPORT 0x3f001234
#define RCV_FILEDATA 0x3f001235
#define TS_StockDrv_IdTxt "TongShi_StockDrv_2.00"
#define SH_MARKET_EX 'HS'
#define SZ_MARKET_EX 'ZS'
#define HK_MARKET_EX 'KH'
#define FILE_HISTORY_EX 2
#define FILE_MINUTE_EX 4
#define FILE_POWER_EX 6
#define FILE_BASE_EX 0x1000
#define FILE_NEWS_EX 0x1002
#define FILE_HTML_EX 0x1004
#define FILE_SOFTWARE_EX 0x2000
#define FILE_SHAZQDATA_EX 0x3000
#define FILE_TYPE_RES -1
#define News_Sha_Ex 2
#define News_Szn_Ex 4
#define News_Fin_Ex 6
#define News_TVSta_Ex 8
#define News_Unknown_Ex -1
#define RI_IDSTRING 1
#define RI_IDCODE 2
#define RI_VERSION 3
#define RI_ERRRATE 4
#define RI_STKNUM 5
#define RI_SUPPORTEXTHQ 6
#define RI_ENABLEDZHTRANS 7
#define RI_ENABLETS3FILE 8
#define STKLABEL_LEN 10
#define STKNAME_LEN 32
typedef struct GzLxBINData {
WORD m_wMarket;
char m_szLabel[STKLABEL_LEN];
DWORD m_LiXiDate;
double m_fMoney100;
DWORD m_DayNum;
float m_fShowPrice;
}GZLXBINDATA,*PGZLXBINDATA;
typedef struct tagRCV_REPORT_STRUCTEx//: public CObject
{
WORD m_cbSize;
time_t m_time;
WORD m_wMarket;
char m_szLabel[STKLABEL_LEN];
char m_szName[STKNAME_LEN];
float m_fLastClose;
float m_fOpen;
float m_fHigh;
float m_fLow;
float m_fNewPrice;
float m_fVolume;
float m_fAmount;
float m_fBuyPrice[3];
float m_fBuyVolume[3];
float m_fSellPrice[3];
float m_fSellVolume[3];
float m_fBuyPrice4;
float m_fBuyVolume4;
float m_fSellPrice4;
float m_fSellVolume4;
float m_fBuyPrice5;
float m_fBuyVolume5;
float m_fSellPrice5;
float m_fSellVolume5;
} RCV_REPORT_STRUCTEx, *PRCV_REPORT_STRUCTEx;
#define EKE_HEAD_TAG 0xffffffff
typedef struct tagRCV_EKE_HEADEx
{
DWORD m_dwHeadTag;
WORD m_wMarket;
char m_szLabel[STKLABEL_LEN];
}RCV_EKE_HEADEx,*PRCV_EKE_HEADEx;
typedef union tagRCV_HISTORY_STRUCTEx
{
struct
{
time_t m_time;
int m_fOpen;
int m_fHigh;
int m_fLow;
int m_fClose;
int m_fVolume;
int m_fAmount;
int m_fBS;
int m_fME;
int m_fCG;
};
RCV_EKE_HEADEx m_head;
}RCV_HISTORY_STRUCTEx,*PRCV_HISTORY_STRUCTEx;
typedef union tagRCV_MINUTE_STRUCTEx
{
struct{
time_t m_time;
float m_fPrice;
float m_fVolume;
float m_fAmount;
};
RCV_EKE_HEADEx m_head;
}RCV_MINUTE_STRUCTEx,*PRCV_MINUTE_STRUCTEx;
typedef union tagRCV_POWER_STRUCTEx
{
struct
{
time_t m_time;
float m_fGive;
float m_fPei;
float m_fPeiPrice;
float m_fProfit;
};
RCV_EKE_HEADEx m_head;
}RCV_POWER_STRUCTEx,*PRCV_POWER_STRUCTEx;
typedef struct tagRCV_SHAGZ_STRUCTEx
{
WORD m_wMarket;
char m_szLabel[STKLABEL_LEN];
DWORD m_StartDate;
double m_fLiXi100RMB;
DWORD m_DayNum;
float m_fPrice;
}RCV_SHAGZ,*PRCV_SHAGZ;
typedef struct tagRCV_FILE_HEADEx
{
DWORD m_dwAttrib;
DWORD m_dwLen;
union
{
DWORD m_dwSerialNo;
time_t m_FileTime;
};
char m_szFileName[MAX_PATH];
} RCV_FILE_HEADEx,*PRCV_FILE_HEADEx;
typedef struct tagRCV_DATA
{
int m_wDataType;
int m_nPacketNum;
RCV_FILE_HEADEx m_File;
BOOL m_bDISK;
union
{
RCV_REPORT_STRUCTEx * m_pReport;
RCV_HISTORY_STRUCTEx * m_pDay;
RCV_MINUTE_STRUCTEx * m_pMinute;
RCV_POWER_STRUCTEx * m_pPower;
void * m_pData;
};
} RCV_DATA,*PRCV_DATA;
LONG OnStkDataOK(UINT wParam,LONG lParam)
{
union tagSrcStock DOS_StkBuf;
RCV_REPORT_STRUCTEx NEW_StkBuf;
PBYTE pDataBuf;
RCV_DATA Header;
RCV_DATA * pHeader;
DWORD dwFileLen;
int ok;
pHeader = (RCV_DATA *)lParam;
switch( wParam )
{
case RCV_REPORT:
for(i=0;
i<pHeader->m_nPacketNum;
i++)
{
pHeader->m_pReport ...

}
break;
case RCV_FILEDATA:
switch(pHeader->m_wDataType)
{
case FILE_HISTORY_EX:
break;
case FILE_MINUTE_EX:
break;
case FILE_POWER_EX:
break;
case FILE_BASE_EX:
break;
case FILE_NEWS_EX:
break;
case FILE_HTML_EX:
break;
case FILE_SOFTWARE_EX:
break;
}
break;
default:
return 0;
}
return 1;
}
#ifdef __cplusplus
extern "C"{
#endif
int WINAPI Stock_Init(HWND hWnd,UINT Msg,int nWorkMode);
int WINAPI Stock_Quit(HWND hWnd);
int WINAPI GetTotalNumber();
int WINAPI GetStockByNoEx(int nNo,RCV_REPORT_STRUCTEx * pBuf);
int WINAPI GetStockByCodeEx(char * pszStockCode,int nMarket,RCV_REPORT_STRUCTEx * pBuf);
int WINAPI SetupReceiver(BOOL bShowWindow);
DWORD WINAPI GetStockDrvInfo(int nInfo,void * pBuf);
#ifdef __cplusplus
}
#endif
#endif _
 
const
RCV_WORK_SENDMSG = 4;

RCV_REPORT = 0x3f001234;
RCV_FILEDATA = 0x3f001235;
TS_StockDrv_IdTxt = 'TongShi_StockDrv_2.00';
SH_MARKET_EX = 'HS';
SZ_MARKET_EX = 'ZS';
HK_MARKET_EX = 'KH';
FILE_HISTORY_EX = 2;
FILE_MINUTE_EX = 4;
FILE_POWER_EX = 6;
FILE_BASE_EX = 0x1000;
FILE_NEWS_EX = 0x1002;
FILE_HTML_EX = 0x1004;
FILE_SOFTWARE_EX = 0x2000;
FILE_SHAZQDATA_EX = 0x3000;
FILE_TYPE_RES = -1;
News_Sha_Ex = 2;

News_Szn_Ex = 4;

News_Fin_Ex = 6;

News_TVSta_Ex = 8;

News_Unknown_Ex = -1;
RI_IDSTRING = 1;
RI_IDCODE = 2;
RI_VERSION = 3;
RI_ERRRATE = 4;
RI_STKNUM = 5;
RI_SUPPORTEXTHQ = 6;
RI_ENABLEDZHTRANS = 7;
RI_ENABLETS3FILE = 8;
STKLABEL_LEN = 10;
STKNAME_LEN = 32;
type
PGZLXBINDATA = ^TGzLxBINData;
TGzLxBINData = packet record
m_wMarket :WORD;
m_szLabel :array[0..STKLABEL_LEN] of char;
m_LiXiDate :DWORD;

m_fMoney100 :double;

m_DayNum :DWORD;

m_fShowPrice :double;

end;
......太多了,应该不是很困难
 
先谢谢!前面的数据类型定义好理解,关键是后面函数,如何转啊?麻烦再看看,如果300分不够还可以加。
 
有一个freepascal组织,他们有类似的工具,你可以试试看
 
后退
顶部