private void btnQuery_Click(object sender, EventArgs e) { if (m_UserAccount == "") { MessageBox.Show("請選擇期貨帳號"); return; } int nStatus = 0; if (boxReportStatus.SelectedIndex >= 0) { nStatus = boxReportStatus.SelectedIndex; } string strType = boxKind.Text; FOnGetBSTR fOnStopLossReport = new FOnGetBSTR(OnStopLossReport); m_nCode = Functions.RegisterOnStopLossReportCallBack(fOnStopLossReport); m_nCode = Functions.GetStopLossReport(m_UserAccount, nStatus, strType); if (m_nCode != 0) { GetMessage("GetStopLossReport", m_nCode, ""); } }
private void OverseaFutureProduct_Load(object sender, EventArgs e) { //Get Oversea Product int m_nCode; FOnGetBSTR fOnOverseaFuture = new FOnGetBSTR(OnOverseaFuture); m_nCode = Functions.RegisterOnOverseaFuturesCallBack(fOnOverseaFuture); m_nCode = Functions.GetOverseaFutures(); }
private void btnQueryReport_Click(object sender, EventArgs e) { //Get RealBalanceReport FOnGetBSTR fRealBalanceReport = new FOnGetBSTR(OnRealBalanceReportCallBack); m_nCode = Functions.RegisterOnRealBalanceReportCallBack(fRealBalanceReport); m_nCode = Functions.GetRealBalanceReport(m_UserAccount); GC.KeepAlive(fRealBalanceReport); if (m_nCode != 0) { GetMessage("GetRealBalanceReport", m_nCode, ""); } }
private void btnInitialize_Click(object sender, EventArgs e) { string strPassword; boxStockAccount.Items.Clear(); boxFutureAccount.Items.Clear(); boxOSStockAccount.Items.Clear(); boxOSFutureAccount.Items.Clear(); m_strLoginID = txtAccount.Text.Trim(); strPassword = txtPassWord.Text.Trim(); //Initialize SKOrderLib m_nCode = Functions.SKOrderLib_Initialize(m_strLoginID, strPassword); if (m_nCode == 0) { MessageBox.Show("Initialize Success"); } else if (m_nCode == 2003) { MessageBox.Show("元件已初始過,無須重複執行"); } else { MessageBox.Show("Initialize Fail:code " + GetApiCodeDefine(m_nCode)); return; } //Initialize Cert m_nCode = Functions.SKOrderLib_ReadCertByID(m_strLoginID); if (m_nCode == 0) { MessageBox.Show("ReadCert Success"); } //Get Account FOnGetBSTR fAccount = new FOnGetBSTR(OnAccount); m_nCode = Functions.RegisterOnAccountCallBack(fAccount); m_nCode = Functions.GetUserAccount(); //OrderAsync CallBack m_nCode = Functions.RegisterOnOrderAsyncReportCallBack(fOrderAsync); m_nCode = Functions.RegisterOnExecutionReportCallBack(fOnExecutionReport); }
private void btnQuery_Click(object sender, EventArgs e) { if (m_UserAccount == "") { MessageBox.Show("請選擇期貨帳號"); return; } FOnGetBSTR fOpenInterest = new FOnGetBSTR(OnOpenInterestCallBack); m_nCode = Functions.RegisterOnOpenInterestCallBack(fOpenInterest); m_nCode = Functions.GetOpenInterest(m_UserAccount); GC.KeepAlive(fOpenInterest); if (m_nCode != 0) { GetMessage("GetOpenInterest", m_nCode, ""); } }
public static extern int RegisterOnOverseaFuturesCallBack(FOnGetBSTR OnOpenInterest);
public static extern int RegisterOnOpenInterestCallBack(FOnGetBSTR OnOpenInterest);
public static extern int RegisterOnAccountCallBack(FOnGetBSTR Account);
private void btnInitialize_Click(object sender, EventArgs e) { string strPassword; boxStockAccount.Items.Clear(); boxFutureAccount.Items.Clear(); boxOSStockAccount.Items.Clear(); boxOSFutureAccount.Items.Clear(); m_strLoginID = txtAccount.Text.Trim(); strPassword = txtPassWord.Text.Trim(); //Initialize SKOrderLib m_nCode = Functions.SKOrderLib_Initialize(m_strLoginID, strPassword); if (m_nCode == 0) MessageBox.Show("Initialize Success"); else if (m_nCode == 2003) { MessageBox.Show("元件已初始過,無須重複執行"); } else { MessageBox.Show("Initialize Fail:code " + GetApiCodeDefine(m_nCode)); return; } //Initialize Cert m_nCode = Functions.SKOrderLib_ReadCertByID(m_strLoginID); if (m_nCode == 0) MessageBox.Show("ReadCert Success"); //Get Account FOnGetBSTR fAccount = new FOnGetBSTR(OnAccount); m_nCode = Functions.RegisterOnAccountCallBack(fAccount); m_nCode = Functions.GetUserAccount(); //OrderAsync CallBack m_nCode = Functions.RegisterOnOrderAsyncReportCallBack(fOrderAsync); m_nCode = Functions.RegisterOnExecutionReportCallBack(fOnExecutionReport); }
public static extern int RegisterOnRealBalanceReportCallBack(FOnGetBSTR RealBalanceReport);
public static extern int RegisterOnStopLossReportCallBack(FOnGetBSTR OnTSCanceledOrder);