当前位置: 首页>>代码示例>>C++>>正文


C++ CSession::Close方法代码示例

本文整理汇总了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();
}
开发者ID:redame,项目名称:Trading,代码行数:35,代码来源:LimitMappingScripwise.cpp


注:本文中的CSession::Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。