|
typedef struct _tagCDMALog
{
int PROVINCE_ID;
int CITY_ID;
int OMC_ID;
int BSC_ID;
char FILENAME[256];
char TABLENAME[32];
char DATA_TIME[32];
char INSERT_START_TIME[32];
char INSERT_END_TIME[32];
int INSERT_SUCC_NUM;
int INSERT_FAIL_NUM;
int INSERT_ALL_NUM;
char VENDOR[8];
} CDMALOG, *PCDMALOG;
class CBaseSummarize
{
public:
CBaseSummarize();
CBaseSummarize(int x);
public:
CDMALOG cdmaLog;
};
CBaseSummarize::CBaseSummarize()
{
memset(&cdmaLog, 0, sizeof(cdmaLog));
}
CBaseSummarize::CBaseSummarize(int x)
{
//CBaseSummarize(); //这样调用并不能让 cdmaLog清0
memset(&cdmaLog, 0, sizeof(cdmaLog)); //这样可以清0
}
class CModDoCdlCfcApLucSum2:public CBaseSummarize
{
public:
CModDoCdlCfcApLucSum2(int x);
};
CModDoCdlCfcApLucSum2::CModDoCdlCfcApLucSum2(int x) : CBaseSummarize(x)
{
}
void CstrtestDlg::OnBnClickedButtonJc()
{
CModDoCdlCfcApLucSum2 dd(11);
dd.cdmaLog.PROVINCE_ID = 1;
dd.cdmaLog.CITY_ID = 2;
dd.cdmaLog.OMC_ID = 3;
dd.cdmaLog.BSC_ID = 4;
strncpy(dd.cdmaLog.DATA_TIME, "20120202", sizeof(dd.cdmaLog.DATA_TIME));
strncpy(dd.cdmaLog.VENDOR, "ZY0810", sizeof(dd.cdmaLog.VENDOR));
}
|
|