本文整理汇总了C++中CKData::SetKType方法的典型用法代码示例。如果您正苦于以下问题:C++ CKData::SetKType方法的具体用法?C++ CKData::SetKType怎么用?C++ CKData::SetKType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKData
的用法示例。
在下文中一共展示了CKData::SetKType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnStkReceiverData
LRESULT CDownloadDlg::OnStkReceiverData(WPARAM wParam, LPARAM lParam)
{
PCOMMPACKET pCommPacket = (PCOMMPACKET)lParam;
switch( wParam )
{
case CStock::dataReport:
if( pCommPacket && CStock::dataReport == pCommPacket->m_dwDataType
&& pCommPacket->m_dwCount > 0 )
{
m_nReportCount += pCommPacket->m_dwCount;
for( DWORD i=0; i<pCommPacket->m_dwCount; i++ )
{
CKData kdata;
kdata.SetKType( CKData::ktypeDay );
KDATA kd;
if( UpdateKDATAByREPORT( kd, &(pCommPacket->m_pReport[i]) ) )
{
kdata.Add( kd );
AfxGetDB().InstallKData( kdata, FALSE );
}
}
CStockContainer & container = AfxGetStockContainer();
if( m_nReportRequestSent - m_nReportCount < 64 && m_nReportRequestSent < (UINT)container.GetSize() )
{
container.Lock();
m_nReportRequestSent += AfxGetStkReceiver().RequestStockData( CStock::dataReport, container.GetData()+m_nReportRequestSent, min(160,container.GetSize()-m_nReportRequestSent), 0, 0 );
container.UnLock();
}
if( !m_bReportFinished && m_nReportCount > 0.95 * m_nReportTotal )
{
m_bReportFinished = TRUE;
::SendMessage( GetSafeHwnd(), WM_USER_DOWNLOAD_PROGRESS, STKLIB_MAX_PROGRESS, NULL );
AfxBeginThread( DownloadMain, (LPVOID)m_pDownloadInfo,THREAD_PRIORITY_NORMAL);
}
else if( !m_bReportFinished && m_nReportTotal > 0 )
{
DWORD dwProgress = STKLIB_MAX_PROGRESS * m_nReportCount / m_nReportTotal;
::SendMessage( GetSafeHwnd(), WM_USER_DOWNLOAD_PROGRESS, dwProgress, NULL );
}
}
break;
}
return 0L;
}