Example #1
0
        public bool start()
        {
            if (connected() == true)
            {
                return(true);
            }

            if (khOpenApi_.CommConnect() != 0)
            {
                Logger.getInstance.print(Log.에러, "로그인창 열기 실패");
                return(false);
            }

            Logger.getInstance.print(Log.API조회, "로그인창 열기 성공");
            //ocx 콜백 함수 등록
            khOpenApi_.OnReceiveTrData        += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveTrDataEventHandler(axKHOpenAPI_OnReceiveTrData);
            khOpenApi_.OnReceiveRealData      += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveRealDataEventHandler(axKHOpenAPI_OnReceiveRealData);
            khOpenApi_.OnReceiveMsg           += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveMsgEventHandler(axKHOpenAPI_OnReceiveMsg);
            khOpenApi_.OnReceiveChejanData    += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveChejanDataEventHandler(axKHOpenAPI_OnReceiveChejanData);
            khOpenApi_.OnEventConnect         += new AxKHOpenAPILib._DKHOpenAPIEvents_OnEventConnectEventHandler(axKHOpenAPI_OnEventConnect);
            khOpenApi_.OnReceiveRealCondition += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveRealConditionEventHandler(axKHOpenAPI_OnReceiveRealCondition);
            khOpenApi_.OnReceiveTrCondition   += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveTrConditionEventHandler(axKHOpenAPI_OnReceiveTrCondition);
            khOpenApi_.OnReceiveConditionVer  += new AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveConditionVerEventHandler(axKHOpenAPI_OnReceiveConditionVer);

            return(true);
        }
 public int Connect()
 {
     return(conn.CommConnect());
 }
Example #3
0
 private void Login()
 {
     axKHOpenAPI.OnEventConnect += AxKHOpenAPI1_OnEventConnect1;
     axKHOpenAPI.CommConnect();
 }