void CDlgOrder::OnBtnAddComboLegs() { CDlgComboLegs dlgComboLegs(m_contract->comboLegs, m_order->orderComboLegs, m_exchange); if ( dlgComboLegs.DoModal() == IDOK ) { // do nothing - params passed by ref // and is being updated inside dialog } }
void CDlgOrder::OnBtnAddComboLegs() { if (!m_pTws) return; UpdateData(); CComQIPtr<IComboLegList> comboLegs; CComQIPtr<IOrderComboLegList> orderComboLegs; typedef CComPropAccessor<IContract> PropsComboLeg; typedef CComPropAccessor<IOrder> PropsOrderComboLeg; PropsComboLeg::GetQI(comboLegs, m_comContract, &IContract::get_comboLegs); PropsOrderComboLeg::GetQI(orderComboLegs, m_comOrder, &IOrder::get_orderComboLegs); CDlgComboLegs dlgComboLegs(comboLegs, orderComboLegs, m_exchange, m_pTws); if ( dlgComboLegs.DoModal() == IDOK ) { comboLegs = dlgComboLegs.getComboLegs(); orderComboLegs = dlgComboLegs.getOrderComboLegs(); PropsComboLeg::Put(m_comContract, comboLegs, &IContract::putref_comboLegs); PropsOrderComboLeg::Put(m_comOrder, orderComboLegs, &IOrder::putref_orderComboLegs); } }