16,004,653 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Member 10362802
3-Jul-14 3:02am
View
Thanks, I have undated the question, can you please check it?
Looking forward to your reply,
Sincerely,
Zhishang
Member 10362802
3-Jul-14 2:59am
View
Thank you very much.
I have been a java programer and new to cpp, many details make me frustrated.
The question was undated, can you please check it and give me some suggestion?
Thanks.
Member 10362802
3-May-14 21:34pm
View
Thanks Richard,
There must be some problem in my console project.
Just now I switch the console project to winForm project and the problem was gone...
Thanks you again for the kindly help!
Sincerely,
Zhishang
Member 10362802
1-May-14 10:37am
View
Thanks!
Member 10362802
1-May-14 10:20am
View
but it is really disappointed that the program crash and print:
forrtl: error (200): program aborting due to window-CLOSE' event
whenever you click 'X' , especially this is a trade system.
Member 10362802
1-May-14 9:52am
View
Thanks for you kindly help!
Actually, I am building a trade system, the cpp program is a multi-thread project,
receiving market data then sending this data to the strategy by invoking matlab function,
finally send order according to the return value.
the program will not end except shutdown manually.
do you mean I should catch the 'windows-close' event then release the resource before invoking
//libsen_tradeTerminate();
//mclTerminateApplication();
Thanks!
Member 10362802
1-May-14 7:16am
View
sorry for the poor hand writing.<br>
<br>
Actually, I am invoking matlab function in a c++ win32 console project.
Member 10362802
7-Feb-14 8:16am
View
Thanks very much!!
@CHill60
Show More