Click here to Skip to main content
15,886,137 members

Comments by Member 10362802 (Top 13 by date)

Member 10362802 27-Nov-14 4:45am View    
Deleted
Sorry, I haven't noted there's similar problem no the network.

Firstly, there's no error or exception occurs.

Code bellow related to Log File Generation:
-------------------------------
//Global variable
std::ofstream outLog;//Record connect/disconnect/login/Subscribe MarketData msg of the program
std::ofstream receivedSignalLog;//Record signal receive from mathlab
//...many more like this

//OpenLog() Definition
---------------------
void openLog()
{
char SystemLogFileName[100]="";
char receivedSignalLogFileName[100]="";
char ordSendedLogFileName[100]="";
char ordInsertLogFileName[100]="";
char errOrdInsertLogFileName[100]="";
char rtnOrdLogFileName[100]="";
char rtnTrdLogFileName[100]="";

char tickDataLogFileName[100]="";
char minDataLogFileName[100]="";
char sysDate[20]="";
GetLocalTime(&sysTime);

sprintf_s(sysDate, "%d-%d-%d",sysTime.wYear,sysTime.wMonth,sysTime.wDay);

strcat_s(SystemLogFileName,100,"Log\\KABStrategist_Log_");
strcat_s(SystemLogFileName,100,sysDate);
strcat_s(SystemLogFileName,100,".txt");
outLog.open(SystemLogFileName,std::ios::app);

strcat_s(receivedSignalLogFileName,100,"Log\\KABStrategist_Signal_Log_");
strcat_s(receivedSignalLogFileName,100,sysDate);
strcat_s(receivedSignalLogFileName,100,".txt");
receivedSignalLog.open(receivedSignalLogFileName,std::ios::app);
receivedSignalLog<<"SignalReceivedTime,FrontID,SessionID,StrategyID,SignalID,InstrumentID,Parma1,Parma2,Parma3,Parma4"<<endl;
receivedSignalLog.flush();
//...Similar structure
}

//Main function()
-------------------------
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);

hInst=hInstance;

//<<<--------------------Begin Initialization------------------>>>>

for(int i=0;i
Member 10362802 27-Nov-14 4:38am View    
Deleted
Sorry, I don't know there's similar problem no the network.

Code related to Log File Generation:
---------------------------------------
//Global definition:
std::ofstream outLog;//Record connect/disconnect/login/Subscribe MarketData msg of the program
std::ofstream receivedSignalLog;//Record signal receive from mathlab
std::ofstream ordSendedLog;//Record order post to ctp
std::ofstream ordInsertLog;//Record params from onRspOrdInsert()
std::ofstream errOrdInsertLog;//Record params from onErrRspOrdInsert()
std::ofstream rtnOrdLog;//Record params from onRtnOrder();
std::ofstream rtnTradeLog;//Record params from onRtnTrade();


std::ofstream IF_HotContractTickDataLog;// Store the tick data of index future
std::ofstream IF_HotContractMinuteDataLog;//store the minute data of index future

std::ofstream SR_HotContractTickDataLog;
std::ofstream SR_HotContractMinuteDataLog;

std::ofstream TA_HotContractTickDataLog;
std::ofstream TA_HotContractMinuteDataLog;

std::ofstream jd_HotContractTickDataLog;
std::ofstream jd_HotContractMinuteDataLog;

std::ofstream cu_HotContractTickDataLog;
std::ofstream cu_HotContractMinuteDataLog;

std::ofstream ru_HotContractTickDataLog;
std::ofstream ru_HotContractMinuteDataLog;
//.....

//OpenLog() Definition
-----------------------------------------
void openLog()
{
char SystemLogFileName[100]="";
char receivedSignalLogFileName[100]="";
char ordSendedLogFileName[100]="";
char ordInsertLogFileName[100]="";
char errOrdInsertLogFileName[100]="";
char rtnOrdLogFileName[100]="";
char rtnTrdLogFileName[100]="";

char tickDataLogFileName[100]="";
char minDataLogFileName[100]="";
char sysDate[20]="";
GetLocalTime(&sysTime);

sprintf_s(sysDate, "%d-%d-%d",sysTime.wYear,sysTime.wMonth,sysTime.wDay);

strcat_s(SystemLogFileName,100,"Log\\KABStrategist_Log_");
strcat_s(SystemLogFileName,100,sysDate);
strcat_s(SystemLogFileName,100,".txt");
outLog.open(SystemLogFileName,std::ios::app);

strcat_s(receivedSignalLogFileName,100,"Log\\KABStrategist_Signal_Log_");
strcat_s(receivedSignalLogFileName,100,sysDate);
strcat_s(receivedSignalLogFileName,100,".txt");
receivedSignalLog.open(receivedSignalLogFileName,std::ios::app);
receivedSignalLog<<"SignalReceivedTime,FrontID,SessionID,StrategyID,SignalID,InstrumentID,Parma1,Parma2,Parma3,Parma4"<<endl;
receivedSignalLog.flush();

strcat_s(ordSendedLogFileName,100,"Log\\KABStrategist_PostedOrd_Log_");
strcat_s(ordSendedLogFileName,100,sysDate);
strcat_s(ordSendedLogFileName,100,".txt");
ordSendedLog.open(ordSendedLogFileName,std::ios::app);
ordSendedLog<<"OrdPostTime,FrontID,SessionID,StrategyID,SignalID,InstrumentID,OrdRef,Direction,OffsetFlag,Volume"<<endl;
ordSendedLog.flush();

strcat_s(ordInsertLogFileName,100,"Log\\KABStrategist_OrdInsert_Log_");
strcat_s(ordInsertLogFileName,100,sysDate);
strcat_s(ordInsertLogFileName,100,".txt");
ordInsertLog.open(ordInsertLogFileName,std::ios::app);
ordInsertLog<<"OnOrdInsertTime,FrontID,SessionID,OrdRef,ErrorID,ErrorMSG"<<endl;
ordInsertLog.flush();

strcat_s(errOrdInsertLogFileName,100,"Log\\KABStrategist_errOrdInsert_Log_");
strcat_s(errOrdInsertLogFileName,100,sysDate);
strcat_s(errOrdInsertLogFileName,100,".txt");
errOrdInsertLog.open(errOrdInsertLogFileName,std::ios::app);
errOrdInsertLog<<"OnErrorOrdInsertTime,FrontID,SessionID,OrdRef,ErrorID,ErrorMSG"<<endl;
errOrdInsertLog.flush();

strcat_s(rtnOrdLogFileName,100,"Log\\KABStrategist_RtnOrd_Log_");
strcat_s(rtnOrdLogFileName,100,sysDate);
strcat_s(rtnOrdLogFileName,100,".txt");
rtnOrdLog.open(rtnOrdLogFileName,std::ios::app);
rtnOrdLog<<"OnRtnOrdTime,FrontID,SessionID,OrdRef,ExchangeID,OrdSystemID"<<endl;
rtnOrdLog.flush();

strcat_s(rtnTrdLogFileName,100,"Log\\KABStrategist_RtnTrd_Log_");
strcat_s(rtnTrdLogFileName,100,sysDate);
strcat_s(rtnTrdLogFileName,100,".txt");
rtnTradeLog.open(rtnTrdLogFileName,std::ios::app);
//rtnTradeLog<<"OnRtnTradeTime,Exchan
Member 10362802 4-Jul-14 2:45am View    
Thank you very much,

'Win32 SDK C Tab Control Made Easy' is very useful, but hard to compile for beginner, also it provide less detail on 'Operation'.

Because it is a win32 project, I can't enjoy 'MFC TabCtrl'.

But thanks against for your kindly help!

Sincerely,

Zhishang
Member 10362802 4-Jul-14 2:38am View    
Thanks for your detail explanation.

Just set the STYLE resource definition in dialog resource to WS_CHILD solve the problem.

I also find http://www.dreamincode.net/forums/topic/163690-microsoft-working-with-tab-controls Very usefull

Sincerely,

Zhishang.
Member 10362802 4-Jul-14 2:32am View    
Thanks,

Set the STYLE resource definition in dialog resource to WS_CHILD solve the problem.

Sincerely,

Zhishang.