diff --git a/CPRobot.rc b/CPRobot.rc index f62741c..6ca06e6 100644 --- a/CPRobot.rc +++ b/CPRobot.rc @@ -71,6 +71,7 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDR_MAINFRAME ICON "res\\CPRobot.ico" +IDI_ICON_STOCK ICON "res\\HandDrawIcon.ico" ///////////////////////////////////////////////////////////////////////////// // @@ -83,8 +84,8 @@ EXSTYLE WS_EX_APPWINDOW CAPTION "Option Robot" FONT 8, "MS Shell Dlg", 400, 0, 0x0 BEGIN - PUSHBUTTON "Àܰí È®ÀÎ\n¹×\nµ¥ÀÌÅÍ ·Îµå",IDC_BUTTON_REFRESH_BALANCE,263,11,50,28,BS_MULTILINE - GROUPBOX "°Å·¡ ±Ý¾×",IDC_STATIC,7,7,252,34 + PUSHBUTTON "Àܰí È®ÀÎ\n¹×\nµ¥ÀÌÅÍ ·Îµå",IDC_BUTTON_REFRESH_BALANCE,263,11,50,28,BS_MULTILINE | NOT WS_VISIBLE | NOT WS_TABSTOP + GROUPBOX "°Å·¡ ±Ý¾×",IDC_STATIC,7,7,305,34 EDITTEXT IDC_EDIT_ORDERINGPRICE,16,20,67,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER LTEXT "¿ø",IDC_STATIC_BALANCE,87,23,134,8,NOT WS_GROUP GROUPBOX "¸Å¼ö Á¶°Ç",IDC_STATIC,7,44,305,38 @@ -108,7 +109,7 @@ BEGIN EDITTEXT IDC_EDIT_CANCEL_DELAY,251,102,38,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER LTEXT "ms",IDC_STATIC,290,106,10,8,NOT WS_GROUP PUSHBUTTON "°Ë»ö",IDC_BUTTON_SEARCH,205,131,50,14 - PUSHBUTTON "°Å·¡ ½ÃÀÛ",IDC_BUTTON_START_DEAL,263,131,50,14 + DEFPUSHBUTTON "°Å·¡ ½ÃÀÛ",IDC_BUTTON_START_DEAL,263,131,50,14 LISTBOX IDC_LIST_ITEMS,7,150,305,86,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END diff --git a/CPRobot.vcproj b/CPRobot.vcproj index 7ea6ad6..dcd8231 100644 --- a/CPRobot.vcproj +++ b/CPRobot.vcproj @@ -268,6 +268,10 @@ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > + + @@ -280,6 +284,14 @@ RelativePath=".\res\CPRobot.rc2" > + + + + diff --git a/CPRobotDlg.cpp b/CPRobotDlg.cpp index 8017bfd..a7a266a 100644 Binary files a/CPRobotDlg.cpp and b/CPRobotDlg.cpp differ diff --git a/CPRobotDlg.h b/CPRobotDlg.h index 83ffd85..c7d5425 100644 --- a/CPRobotDlg.h +++ b/CPRobotDlg.h @@ -4,7 +4,6 @@ #pragma once #include "afxwin.h" #include "EventHandler.h" -#include "OptionEventHandler.h" #include "Trader.h" #include #include @@ -34,7 +33,7 @@ enum CP_STATE }; // CCPRobotDlg ´ëÈ­ »óÀÚ -class CCPRobotDlg : public CDialog, public IEventHandler +class CCPRobotDlg : public CDialog, public IEventHandlerSysDib, public IEventHandlerDib { // »ý¼ºÀÔ´Ï´Ù. public: @@ -52,7 +51,8 @@ public: afx_msg void OnHotKey(UINT nHotKeyId, UINT nKey1, UINT nKey2); - virtual void Received(); + virtual void ReceivedSysDib(); + virtual void ReceivedDib(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV Áö¿øÀÔ´Ï´Ù. @@ -77,7 +77,7 @@ private: vector m_OpCodeList; CpSysDib::ISysDibPtr m_pOpJpBid; - CEventHandlerSysDib m_EventHandler; + CEventHandlerSysDib m_EventHandlerSysDib; string m_AccountNum; @@ -101,6 +101,9 @@ private: int m_iOrderNum; CTime m_BoughtT; + CpDib::IDibPtr m_pCpFConclusion; + CEventHandlerDib m_EventHandlerDib; + ATOM m_IdKeyFxCall; ATOM m_IdKeyFxPut; ATOM m_IdKeyFxStop; @@ -116,7 +119,4 @@ private: inline void SwitchState(const CP_STATE enState); void CPLog(const std::string fmt, ...); - -public: - afx_msg void OnBnClickedButton1(); }; diff --git a/EventHandler.cpp b/EventHandler.cpp index c22851c..2776cb5 100644 --- a/EventHandler.cpp +++ b/EventHandler.cpp @@ -3,7 +3,7 @@ #include "stdafx.h" #include "EventHandler.h" -void CEventHandlerSysDib::SetIEventHandler(IEventHandler* pIEventHandler) +void CEventHandlerSysDib::SetIEventHandler(IEventHandlerSysDib* pIEventHandler) { m_pIEventHandler = pIEventHandler; } @@ -12,6 +12,19 @@ void __stdcall CEventHandlerSysDib::Received() { ASSERT(NULL != m_pIEventHandler); - m_pIEventHandler->Received(); + m_pIEventHandler->ReceivedSysDib(); } + + +void CEventHandlerDib::SetIEventHandler(IEventHandlerDib* pIEventHandler) +{ + m_pIEventHandler = pIEventHandler; +} + +void __stdcall CEventHandlerDib::Received() +{ + ASSERT(NULL != m_pIEventHandler); + + m_pIEventHandler->ReceivedDib(); +} \ No newline at end of file diff --git a/EventHandler.h b/EventHandler.h index 0192de9..5c0b504 100644 --- a/EventHandler.h +++ b/EventHandler.h @@ -6,10 +6,16 @@ #include #include -class IEventHandler +class IEventHandlerSysDib { public: - virtual void Received() = 0; + virtual void ReceivedSysDib() = 0; +}; + +class IEventHandlerDib +{ +public: + virtual void ReceivedDib() = 0; }; @@ -22,7 +28,7 @@ class CEventHandlerSysDib : public IDispEventImpl< 0> { public: - void SetIEventHandler(IEventHandler* pIEventHandler); + void SetIEventHandler(IEventHandlerSysDib* pIEventHandler); void __stdcall Received(); @@ -31,7 +37,7 @@ public: END_SINK_MAP() protected: - IEventHandler* m_pIEventHandler; + IEventHandlerSysDib* m_pIEventHandler; }; class CEventHandlerDib : public IDispEventImpl< @@ -43,7 +49,7 @@ class CEventHandlerDib : public IDispEventImpl< 0> { public: - void SetIEventHandler(IEventHandler* pIEventHandler); + void SetIEventHandler(IEventHandlerDib* pIEventHandler); void __stdcall Received(); @@ -52,7 +58,7 @@ public: END_SINK_MAP() protected: - IEventHandler* m_pIEventHandler; + IEventHandlerDib* m_pIEventHandler; }; #endif /* __EVNET_HANDLER_H__ */ diff --git a/res/CPRobot.ico b/res/CPRobot.ico index 8a84ca3..534f30b 100644 Binary files a/res/CPRobot.ico and b/res/CPRobot.ico differ diff --git a/res/HandDrawIcon.ico b/res/HandDrawIcon.ico new file mode 100644 index 0000000..a9a8e22 Binary files /dev/null and b/res/HandDrawIcon.ico differ diff --git a/resource.h b/resource.h index f9dbfe5..d3a749a 100644 --- a/resource.h +++ b/resource.h @@ -5,6 +5,8 @@ #define IDD_CPROBOT_DIALOG 102 #define IDD_CPROBOT_DIALOG2 102 #define IDR_MAINFRAME 128 +#define IDI_ICON2 132 +#define IDI_ICON_STOCK 132 #define IDC_EDIT_ORDERING_TICK_MIN 1000 #define IDC_EDIT_ORDERING_TICK_MAX 1001 #define IDC_BUTTON_SEARCH 1002 @@ -33,7 +35,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_RESOURCE_VALUE 133 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1017 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/stdafx.h b/stdafx.h index c882048..74e6390 100644 --- a/stdafx.h +++ b/stdafx.h @@ -38,7 +38,7 @@ //#include -//#import "c:\daishin\cybosplus\cpdib.dll" rename_namespace("CpDib") +#import "c:\daishin\cybosplus\cpdib.dll" rename_namespace("CpDib") #import "c:\daishin\cybosplus\cpsysdib.dll" rename_namespace("CpSysDib") named_guids #import "c:\daishin\cybosplus\cptrade.dll" no_namespace named_guids #import "c:\daishin\cybosplus\cputil.dll" no_namespace named_guids