本文整理汇总了C++中CSession::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CSession::Close方法的具体用法?C++ CSession::Close怎么用?C++ CSession::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSession
的用法示例。
在下文中一共展示了CSession::Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSymbolData
void LimitMappingScripwise::getSymbolData()
{
HRESULT hr;
CoInitialize(NULL);
CDataSource connection;
CSession session;
CCommand<CAccessor<CTrade_Table> > artists1;
connection.OpenFromInitializationString(L"Provider=SQLNCLI11.1;[email protected];Persist Security Info=False;User ID=sa;Initial Catalog=TradeDataBase;Data Source=68.168.101.187;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WINDOWS-LOJSHQK;Initial File Name=\"\";Use Encryption for Data=False;Tag with column collation when possible=False;MARS Connection=False;DataTypeCompatibility=0;Trust Server Certificate=False;Application Intent=READWRITE");
session.Open(connection);
_bstr_t strCommand="";
CString sel_login=GridTradeAndOrder::m_selected_login;
sel_login=sel_login.Mid(0,6);
_bstr_t strcode=sel_login;
//select distinct symbol,0 as 'Limit','' as 'Client_group','' as 'Client_Group1','' as 'Client_Group2','' as 'v','' as 'ba','' as 'TYPE','' as 'volume' ,'' AS 'cHECKtRADE' from mt5_deals where [Action] in (0,1) and symbol not in (select Symbol from Limit_Mapping where [login]='" + GridTradeAndOrder::m_selected_login + "' )union select Symbol,Limit from Limit_Mapping where [login]='" + GridTradeAndOrder::m_selected_login + "' "
strCommand="select distinct symbol,0 as 'LimitBuy',0 as 'Client_group','' as 'Client_Group1','' as 'Client_Group2','' as 'v','' as 'ba','' as 'TYPE','' as 'volume' ,'' AS 'cHECKtRADE' from mt5_deals where [Action] in (0,1) and symbol not in (select Symbol from Limit_Mapping where [login]='" + GridTradeAndOrder::m_selected_login + "' )union select Symbol,Limit,LimitSell as 'Client_group','' as 'Client_Group1','' as 'Client_Group2','' as 'v','' as 'ba','' as 'TYPE','' as 'volume' ,'' AS 'cHECKtRADE' from Limit_Mapping where [login]='" + GridTradeAndOrder::m_selected_login + "' ";
char* strCommand_char=(char*)strCommand;
hr=artists1.Open(session,strCommand_char);
int rows_count=0;
if(SUCCEEDED(hr))
{
while (artists1.MoveNext() == S_OK)
{
e_grid.QuickSetText(0,rows_count,artists1.m_Symbol );
e_grid.QuickSetText(1,rows_count,artists1.m_Order);
e_grid.QuickSetText(2,rows_count,artists1. m_Time);
rows_count=rows_count+1;
}
}
artists1.Close();
session.Close();
connection.Close();
}