本文整理汇总了C++中CTimeSpan::GetSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ CTimeSpan::GetSeconds方法的具体用法?C++ CTimeSpan::GetSeconds怎么用?C++ CTimeSpan::GetSeconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTimeSpan
的用法示例。
在下文中一共展示了CTimeSpan::GetSeconds方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CString CTradeStatistic2::CalculateElapseTime()
{
CString strElapsedTime;
CTime tmNow = CTime::GetCurrentTime();
CTimeSpan tElapsed = tmNow - m_tmBegin;
strElapsedTime.Format("%d小时 %d分钟 %d秒", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
return strElapsedTime;
}
示例2: CheckSocketStatus
/*********************************************************
函数名称:CheckSocketStatus
功能描述:检查每个Socket 将其中空的和超时的删除掉
创建时间:2016-08-19
参数说明:
返 回 值:
*********************************************************/
int CSocketServerDlg::CheckSocketStatus(void)
{
POSITION pos = m_listSocketChat.GetHeadPosition();
while(pos != NULL)
{
CChatSocket* p = m_listSocketChat.GetNext(pos);
// 删除空Socket
if(p == NULL)
{
if(pos == NULL)
{// 空Socket位于链表末尾
m_listSocketChat.RemoveTail();
break;
}
else
{
POSITION posTemp = pos;
m_listSocketChat.GetPrev(posTemp);
m_listSocketChat.RemoveAt(posTemp);
}
continue;
}
// 删除超过时间没有通信的Socket
int nMaxSec = 30; // 等待的最大时间
CTimeSpan tmsp;
tmsp = CTime::GetCurrentTime() - p->m_tmLastMsg;
TRACE("%d\n", tmsp.GetTotalSeconds());
if(tmsp.GetTotalSeconds() >= nMaxSec || tmsp.GetSeconds() < 0)
{
CString csOutMsg;
CString csID;
csID = p->m_userID;
csOutMsg.Format(_T("用户%s连接超时"), csID);
OutputInfo(csOutMsg);
m_data.SetUserStatus(p->m_userID, IDS_STATUS_OFFLINE);
p->Close(); // 关闭连接
delete p; // 释放内存
// 删除元素
if(pos == NULL)
{// 空Socket位于链表末尾
m_listSocketChat.RemoveTail();
break;
}
else
{
POSITION posTemp = pos;
m_listSocketChat.GetPrev(posTemp);
m_listSocketChat.RemoveAt(posTemp);
}
continue;
}
}
return 0;
}
示例3: FormatElapsed
string VirtualListCtrlFT::FormatElapsed(CTimeSpan &span)
{
string ret;
char buf[4096];
if(span.GetTotalHours()==0) // < hour
{
sprintf(buf,"%u:%02u",span.GetMinutes(),span.GetSeconds());
}
else // > hour
{
sprintf(buf,"%u:%02u:%02u",span.GetHours(),span.GetMinutes(),span.GetSeconds());
}
ret=buf;
return ret;
}
示例4: UpdateItem
void CDialogToDoHistory::UpdateItem( int iItem )
{
DWORD dwId;
m_listTodoHistory.GetItemData(iItem,dwId);
ToDoTask todo = g_todoSet.GetToDo(dwId);
ATLASSERT(todo.id!=ToDoTask::ERROR_TASKID);
//改变的文字颜色
COLORREF clrBgn,clrText;
m_listTodoHistory.GetItemColours(iItem,m_iColCreateTime,clrBgn,clrText);
m_listTodoHistory.SetItemColours(iItem,m_iColCreateTime,clrBgn,RGB(0X66,0X66,0X66));
m_listTodoHistory.SetSubItemData(iItem,m_iColCreateTime,GlobeFuns::TimeToInt(todo.tmCreateTime));
m_listTodoHistory.SetItemText(iItem,m_iColTitle,todo.strTask.c_str());
m_listTodoHistory.SetItemText(iItem,m_iColPriority,ToDoTask::PriorityText(todo.priority));
m_listTodoHistory.SetItemColours(iItem,m_iColPriority,RGB(10,170-todo.priority*25,10),RGB(0,0,0));
m_listTodoHistory.SetSubItemData(iItem,m_iColPriority,todo.priority);
CString strTime;
if (todo.tmPlanFinshTime>=todo.tmCreateTime)
{
CTimeSpan ts = todo.tmPlanFinshTime-todo.tmCreateTime;
CString strTmp;
if (ts.GetDays()>0)
{
strTmp.Format("%d天",ts.GetDays());
strTime += strTmp;
}
if (ts.GetHours()>0)
{
strTmp.Format("%d时",ts.GetHours());
strTime += strTmp;
}
if (ts.GetDays()==0 //任务持续一天以上的,就不要精确到分钟了。
&& ts.GetMinutes()>0)
{
strTmp.Format("%d分",ts.GetMinutes());
strTime += strTmp;
}
if (strTime.IsEmpty())
{
strTmp.Format("%d秒",ts.GetSeconds());
strTime += strTmp;
}
m_listTodoHistory.SetSubItemData(iItem,m_iColTotleHours,GlobeFuns::TimeToInt(CTime(0)+ts));
}
else
{
strTime = "(无数据)";
}
m_listTodoHistory.SetItemText(iItem,m_iColTotleHours,strTime);
m_listTodoHistory.SetItemText(iItem,m_iColRemark,todo.strRemark.c_str());
}
示例5: test_ServerThread
void test_ServerThread(IUnitTest* _ts)
{
TEST_SUITE(_ts,_T("Pipe"),_T("Pipe Server thread"));
//TRACE(_T("Test server thread ------------------------------------\n"));
CServer1* pserver = trace_alloc(new CServer1(_T("test_pipe")));
pserver->start();
Sleep(100);
CTime t1 = CTime::GetCurrentTime();
delete trace_free(pserver);
CTime t2 = CTime::GetCurrentTime();
CTimeSpan dif = t2 - t1;
ok(dif.GetSeconds()<5,_T("closing pipe server to long"));
}
示例6: CompleteSuccess
void PageProgress::CompleteSuccess(const DFUEngine::Status &status)
{
bool ok = true;
// Start the next operation
CTimeSpan timeSpan = timeEnd - timeStart;
switch (status.state)
{
case DFUEngine::reconfigure:
if (fileUpload.IsEmpty()) ok = dfu.StartDownload(fileDownload);
else ok = dfu.StartUpload(fileUpload);
break;
case DFUEngine::upload:
if (status.result) GetSheet()->pageResults.valueSaved = true;
timeTakenUpload.Format(IDS_RESULTS_MSG_TIME, (int)timeSpan.GetTotalMinutes(), (int)timeSpan.GetSeconds());
ok = dfu.StartDownload(fileDownload);
break;
case DFUEngine::download:
timeTakenDownload.Format(IDS_RESULTS_MSG_TIME, (int)timeSpan.GetTotalMinutes(), (int)timeSpan.GetSeconds());
ok = dfu.StartManifest();
break;
default:
// Otherwise successfully completed
CompleteSuccessLast(status);
break;
}
// Handle failure to start the next operation
if (!ok)
{
// Display the results page
GetSheet()->pageResults.valueTitle.Format(IDS_RESULTS_TITLE_FAIL);
CString &results = GetSheet()->pageResults.valueResults;
results.Format(IDS_RESULTS_MSG_FAIL_INTERNAL);
CString recover;
recover.Format(IDS_RESULTS_MSG_RECOVER_FAIL);
if (!recover.IsEmpty()) results += "\n\n" + recover;
GetSheet()->pageResults.valueAnimation = false;
GetSheet()->pageResults.valueDetails.Empty();
GetSheet()->SetActivePage(&GetSheet()->pageResults);
}
}
示例7: SWait
void CPMotion::SWait(short Seconds) //waits n seconds
{
//OK
CTime WaitUntilTime = CTime::GetCurrentTime();
WaitUntilTime += CTimeSpan(0, 0, 0, Seconds);
bool done = false;
while (!done)
{
m_Robot->DoWindowMessages();
CTime StartTime = CTime::GetCurrentTime();
CTimeSpan TimeDiff = WaitUntilTime - StartTime;
if ((TimeDiff.GetHours() == 0) && (TimeDiff.GetMinutes() == 0) &&
(TimeDiff.GetSeconds() <= 0))
{
done = true;
}
}
}
示例8: RWait
bool CPMotion::RWait(short Seconds) //waits n seconds or exit on nudge
{
//OK
CTime WaitUntilTime = CTime::GetCurrentTime();
WaitUntilTime += CTimeSpan(0, 0, 0, Seconds);
bool done = false;
while ((!done) && (!(m_Robot->m_Nudged)))
{
m_Robot->DoWindowMessages();
CTime StartTime = CTime::GetCurrentTime();
CTimeSpan TimeDiff = WaitUntilTime - StartTime;
if ((TimeDiff.GetHours() == 0) && (TimeDiff.GetMinutes() == 0) &&
(TimeDiff.GetSeconds() <= 0))
{
done = true;
}
}
return (done || (m_Robot->m_Nudged)); // ||boolean
}
示例9: ShowDuration
void SaveBinaryNoParsingDlg::ShowDuration(CTimeSpan ts, UINT id)
{
char buf[128];
//CTimeSpan ts = CTime::GetCurrentTime() - startTime;
if(ts.GetDays() > 0)
{
sprintf_s(buf, 128, "%d day(s) and %02d:%02d:%02d", (int)ts.GetDays(), (int)ts.GetHours(), (int)ts.GetMinutes(), (int)ts.GetSeconds());
}
else
{
sprintf_s(buf, 128, "%02d:%02d:%02d", (int)ts.GetHours(), (int)ts.GetMinutes(), (int)ts.GetSeconds());
}
GetDlgItem(id)->SetWindowText(buf);
}
示例10: DLLBuildDone
void DLLBuildDone()
{
g_hToolThread = NULL;
CTime tEnd = CTime::GetCurrentTime();
CTimeSpan tElapsed = tEnd - g_tBegin;
CString strElapsed;
strElapsed.Format("Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds());
Sys_Printf(strElapsed.GetBuffer(0));
Pointfile_Check();
if (g_PrefsDlg.m_bRunQuake == TRUE)
{
char cCurDir[1024];
GetCurrentDirectory(1024, cCurDir);
CString strExePath = g_PrefsDlg.m_strQuake2;
CString strOrgPath;
CString strOrgFile;
ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
if (g_PrefsDlg.m_bSetGame == TRUE) // run in place with set game.. don't copy map
{
CString strBasePath = ValueForKey(g_qeglobals.d_project_entity, "basepath");
strExePath += " +set game ";
strExePath += strBasePath;
WinExec(strExePath, SW_SHOW);
}
else
{
CString strCopyPath = strExePath;
char* pBuffer = strCopyPath.GetBufferSetLength(_MAX_PATH + 1);
pBuffer[strCopyPath.ReverseFind('\\') + 1] = '\0';
strCopyPath.ReleaseBuffer();
SetCurrentDirectory(strCopyPath);
CString strOrgPath;
CString strOrgFile;
ExtractPath_and_Filename(currentmap, strOrgPath, strOrgFile);
AddSlash(strCopyPath);
FindReplace(strOrgFile, ".map", ".bsp");
strCopyPath += "\\baseq2\\maps\\";
strCopyPath += strOrgFile;
AddSlash(strOrgPath);
strOrgPath += strOrgFile;
bool bRun = (strOrgPath.CompareNoCase(strCopyPath) == 0);
if (!bRun)
bRun = (CopyFile(strOrgPath, strCopyPath, FALSE) == TRUE);
if (bRun)
{
FindReplace(strOrgFile, ".bsp", "");
strExePath += " +map ";
strExePath += strOrgFile;
WinExec(strExePath, SW_SHOW);
}
}
SetCurrentDirectory(cCurDir);
}
}
示例11: CheckBspProcess
void CheckBspProcess( void )
{
char outputpath[1024];
char temppath[512];
DWORD exitcode;
char* out;
BOOL ret;
if ( !bsp_process )
return;
ret = GetExitCodeProcess( bsp_process, &exitcode );
if ( !ret )
Error( "GetExitCodeProcess failed" );
if ( exitcode == STILL_ACTIVE )
return;
bsp_process = 0;
GetTempPath( 512, temppath );
sprintf( outputpath, "%sjunk.txt", temppath );
LoadFile( outputpath, ( void** )&out );
Sys_Printf( "%s", out );
Sys_Printf( "\ncompleted.\n" );
free( out );
CTime tEnd = CTime::GetCurrentTime();
CTimeSpan tElapsed = tEnd - g_tBegin;
CString strElapsed;
strElapsed.Format( "Run time was %i hours, %i minutes and %i seconds", tElapsed.GetHours(), tElapsed.GetMinutes(), tElapsed.GetSeconds() );
Sys_Printf( strElapsed.GetBuffer( 0 ) );
Sys_Beep();
Pointfile_Check();
// run game if no PointFile and pref is set
//++timo needs to stop after BSP if leaked .. does run through vis and light instead ..
if ( g_PrefsDlg.m_bRunQuake == TRUE && !g_qeglobals.d_pointfile_display_list )
{
char cCurDir[1024];
GetCurrentDirectory( 1024, cCurDir );
CString strExePath = "../../qio.exe";
//= g_PrefsDlg.m_strQuake2;
CString strOrgPath;
CString strOrgFile;
ExtractPath_and_Filename( currentmap, strOrgPath, strOrgFile );
if ( g_PrefsDlg.m_bSetGame == TRUE ) // run in place with set game.. don't copy map
{
CString strBasePath = ValueForKey( g_qeglobals.d_project_entity, "basepath" );
strExePath += " +set game ";
strExePath += strBasePath;
WinExec( strExePath, SW_SHOW );
}
else
{
CString strCopyPath = strExePath;
char* pBuffer = strCopyPath.GetBufferSetLength( _MAX_PATH + 1 );
pBuffer[strCopyPath.ReverseFind( '\\' ) + 1] = '\0';
strCopyPath.ReleaseBuffer();
SetCurrentDirectory( strCopyPath );
CString strOrgPath;
CString strOrgFile;
ExtractPath_and_Filename( currentmap, strOrgPath, strOrgFile );
AddSlash( strCopyPath );
FindReplace( strOrgFile, ".map", ".bsp" );
//++timo modified for Quake3 !!
strCopyPath += "baseq3\\maps\\";
strCopyPath += strOrgFile;
AddSlash( strOrgPath );
strOrgPath += strOrgFile;
bool bRun = ( strOrgPath.CompareNoCase( strCopyPath ) == 0 );
if ( !bRun )
bRun = ( CopyFile( strOrgPath, strCopyPath, FALSE ) == TRUE );
if ( bRun )
{
FindReplace( strOrgFile, ".bsp", "" );
strExePath += " +map ";
strExePath += strOrgFile;
WinExec( strExePath, SW_SHOW );
}
}
SetCurrentDirectory( cCurDir );
}
}
示例12: DrawGrid
void COscillogram::DrawGrid(CDC *dc)
{
//_DrawGrid(dc);
CString tempStr;
CSize tempSzie;
int tempPos;
CFont m_cFont, *oldFont;
CPen pen(PS_SOLID,6,m_GridColor);
m_cFont.CreatePointFont(260,"宋体");//"Arial");
oldFont = dc->SelectObject(&m_cFont);
dc->SelectObject(&pen);
dc->SetTextColor(m_xyTextColor);
float m_xTemp = (float)m_GridRect.Width() / (m_xShowCount-1);
float m_yTemp = (float)m_GridRect.Height() / (m_yShowCount-1);
CTimeSpan m_xTimeSpan = 0;
if(m_showTime)
{
CTimeSpan sc = m_endTime - m_beginTime;
double secCount = (sc.GetDays()*86400) + (sc.GetHours()*3600) +
(sc.GetMinutes()*60) + sc.GetSeconds();
secCount = secCount / (m_xShowCount-1);
int day = (int)secCount/86400; //天
secCount -= day*86400;
int hour = (int)secCount/3600; //小时
secCount -= hour*3600;
int minute = (int)secCount/60; //分钟
secCount -= minute*60;
int second = (int)secCount; //秒
m_xTimeSpan = CTimeSpan(day,hour,minute,second);
}
for(int i=0;i<m_xShowCount;i++)
{
tempPos = m_GridRect.left + (int)(m_xTemp*i);
DotLine(dc, tempPos,
m_GridRect.top ,
tempPos ,
m_GridRect.bottom ,
m_GridColor );
if(!m_showTime)
tempStr.Format("%.2f",
(m_xMaxVal-m_xMinVal)/(m_xShowCount-1)
* i + m_xMinVal );
else
{
CTime cnTime = m_beginTime;;
for(int j=0;j<i;j++)
cnTime += m_xTimeSpan;
tempStr = cnTime.Format("%H:%M:%S");//%Y/%m/%d
}
tempSzie = dc->GetTextExtent(tempStr);
dc->TextOut(tempPos - tempSzie.cx/2 ,
m_GridRect.bottom - 15 ,
tempStr );
}
for(int j=0;j<m_yShowCount;j++)
{
tempPos = m_GridRect.top + (int)(m_yTemp*j);
DotLine(dc, m_GridRect.left ,
tempPos ,
m_GridRect.right ,
tempPos ,
m_GridColor );
tempStr.Format("%.2f",
(m_yMaxVal-m_yMinVal)/(m_yShowCount-1)
* (m_yShowCount-1-j) + m_yMinVal );
tempSzie = dc->GetTextExtent(tempStr);
dc->TextOut(m_GridRect.left - tempSzie.cx-15 ,
tempPos + tempSzie.cy/2 ,
tempStr );
}
//X轴文本
tempSzie = dc->GetTextExtent(m_xText);
dc->TextOut(m_GridRect.right + 15,m_GridRect.bottom + tempSzie.cy/2,m_xText);
//Y轴文本
tempSzie = dc->GetTextExtent(m_yText);
dc->TextOut(m_GridRect.left - tempSzie.cx/2,m_GridRect.top + tempSzie.cy + 15,m_yText);
//XY轴线
dc->MoveTo(m_GridRect.left,m_GridRect.top);
dc->LineTo(m_GridRect.left,m_GridRect.bottom);
dc->MoveTo(m_GridRect.left,m_GridRect.bottom);
//.........这里部分代码省略.........
示例13: OnMouseMove
void COscillogram::OnMouseMove(UINT nFlags, CPoint point)
{
CStringArray valArray;
CDWordArray colArray;
CString strVal;
CRect mRect;
CClientDC dc(this);
float length; //鼠标位置绝对象素数
float gValue;
int oldMode;
int curCell; //所在单元格
CPen pen(PS_SOLID,0,RGB(0,0,0));
BOOL PtState = FALSE;
//(整个函数过程的功能)计算所有线所在单元格的数值
oldMode = dc.SetMapMode(MM_LOMETRIC);
SetOscillogramRect(&dc);
dc.SelectObject(&pen);
dc.SetROP2(R2_NOTXORPEN);
dc.DPtoLP(&point);
//如果 鼠标不在波形图内 或者 没有曲线 不做处理返回
if(!(point.x >= m_GridRect.left && point.x <= m_GridRect.right+3
&& point.y <= m_GridRect.top && point.y >= m_GridRect.bottom)
|| GetCurveCount() < 1 || m_showTitle == FALSE)
{
if(m_bPt.x != -1)
{
DrawMouseLine(&dc,m_bPt);
m_bPt =-1;
}
m_TitleTip.ShowWindow(SW_HIDE);
return;
}
//绘画跟随鼠标的十字线
if(m_bPt.x == -1)
{
m_bPt = point;
DrawMouseLine(&dc,point);
}
else
{
DrawMouseLine(&dc,m_bPt);
m_bPt = point;
DrawMouseLine(&dc,point);
}
//计算个单元格数值
length = (float)( point.x - m_GridRect.left );
curCell = (int)( length / m_xSpan );
if(!m_showTime)
{
float n1 = (m_xMaxVal - m_xMinVal)/(m_xCount-1);
float n2 = m_xMinVal + curCell*n1;
strVal.Format("%s: %.2f",m_xText,n2);
}
else
{
CTimeSpan m_xTimeSpan = 0;
CTimeSpan sc = m_endTime - m_beginTime;
CTime cnTime = m_beginTime;
double secCount = (sc.GetDays()*86400) + (sc.GetHours()*3600) +
(sc.GetMinutes()*60) + sc.GetSeconds();
secCount = secCount / (m_xCount-1);
int day = (int)secCount/86400; //天
secCount -= day*86400;
int hour = (int)secCount/3600; //小时
secCount -= hour*3600;
int minute = (int)secCount/60; //分钟
secCount -= minute*60;
int second = (int)secCount; //秒
m_xTimeSpan = CTimeSpan(day,hour,minute,second);
for(int j=0;j<curCell;j++)
cnTime += m_xTimeSpan;
strVal.Format("%s: %s",m_xText,cnTime.Format("%Y/%m/%d %H:%M:%S"));
}
colArray.Add(RGB(0,0,0));
valArray.Add(strVal);
for(int i=0;i<GetCurveCount();i++)
{
gValue = GetCurve(i)->ptVal.GetPointValue(curCell,PtState);
if(PtState)
strVal.Format("%s: %.2f",GetCurveName(i),gValue);
else
strVal.Format("%s: ",GetCurveName(i));
colArray.Add(GetCurve(i)->lColor);
valArray.Add(strVal);
}
//显示浮动窗体
dc.LPtoDP(&point);
dc.SetMapMode(oldMode);
//.........这里部分代码省略.........
示例14: OnInitDialog
BOOL CDlgBankPass::OnInitDialog()
{
__super::OnInitDialog();
SetWindowText(TEXT("保险箱密码"));
if(m_tmLogin == NULL)
m_tmLogin = CTime::GetCurrentTime();
switch(g_GlobalOption.m_BankCloseMode)
{
case enBankRule_LK:
break;
case enBankRule_ZD:
{
CTimeSpan ts = CTime::GetCurrentTime() - m_tmLogin;
int ipass=ts.GetSeconds();
if( ipass <= g_GlobalOption.m_BankCloseTime)
{
m_tmLogin = CTime::GetCurrentTime();
__super::OnOK();
return TRUE;
}
break;
}
case enBankRule_LEAVE: //离开大厅时注销
CGameFrame* pFrame = (CGameFrame*)AfxGetMainWnd();
if(pFrame->m_bIsLogBank == true)
{
__super::OnOK();
return TRUE;
}
break;
}
//设置变量
m_strPassword=TEXT("");
//更新变量
UpdateData(FALSE);
//设置焦点
GetDlgItem(IDC_PASSWORD)->SetFocus();
if(!m_ImageKuang.IsNull())
m_ImageKuang.Destroy();
m_ImageKuang.LoadFromResource(AfxGetInstanceHandle(),IDB_LOCK_KUANG);
CRect rcFrame;
GetWindowRect(&rcFrame);
MoveWindow(&rcFrame,FALSE);
// m_btCancel.SetButtonImage(IDB_FACE_CLOSE,AfxGetInstanceHandle(),false);
//m_btCancel.load
SetWindowPos(NULL,0,0,290,200,SWP_NOMOVE|SWP_NOZORDER|SWP_NOCOPYBITS);
m_ImageBuffer.Destroy();
m_ImageBuffer.Create(290,200,16);
//
//m_btCancel2.LoadStdImage((L"skin/bt_close.png"));
HDWP hDwp=BeginDeferWindowPos(0);
// DeferWindowPos(hDwp,m_btCancel2,NULL,249,1,0,0,SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOCOPYBITS|SWP_NOSIZE);
EndDeferWindowPos(hDwp);
return TRUE;
}
示例15: OnMyMessage
// 处理键盘捕捉的数字按键信息
LRESULT CIncrementSystemBFDlg::OnMyMessage(WPARAM wParam, LPARAM lParam)
{
// lParam&0x800000,如果结果是1,表示是被释放的,也就是抬起的。
if ( !(lParam & 0X80000000)) {
if ((wParam >= 0x30 && wParam <= 0x39)
||(wParam >= 0x60 && wParam <= 0x69)){
timeNow = CTime::GetCurrentTime();
CTimeSpan t = timeNow - timeStart;
if (t.GetSeconds() >= cSystem.PressTimeout){
CString logTime;
logTime.Format(_T("输入间隔超过%d秒,此次按键为号码首位!"), cSystem.PressTimeout);
CLogFile::WriteLog(logTime);
telPos = 0;
timeStart = CTime::GetCurrentTime();
}
if (telPos == 0){
memset(&telPhone, 1, sizeof(telPhone) );
}
CString tempCode;
tempCode.Format("%c", wParam);
memcpy(&telPhone[telPos], tempCode, 1);
CString logStr;
logStr.Format("%d %c -- [%s]%p", telPos, wParam, telPhone, telPhone);
CLogFile::WriteLog(logStr);
telPos++;
}
if (wParam == 0x8){
CLogFile::WriteLog("Enter Back");
CString logStr;
if (telPos <= 1){
telPos = 1;
}
telPhone[telPos-1] = '\0';
logStr.Format("当前号码串为: [%s]", telPhone);
CLogFile::WriteLog(logStr);
telPos--;
if (telPos < 0){
telPos = 0;
}
}
if (wParam == 0x1B){
CLogFile::WriteLog(_T("接收ESC按键 重置输入信息, 下个数字为号码首位!"));
telPos = 0;
}
}
if (telPos >= 11){
telPos = 0;
telPhone[12] = '\0';
log.Format("Server Phone Number : [%s]", telPhone);
CLogFile::WriteLog(log);
if (!checkPhoneIsUnicom(telPhone)){
return 0;
}
//szCharUrl.Format("http://www.baidu.com/s?wd=%s", telPhone);
szCharUrl.Format("%s%s", cUrls.QueryPhone, telPhone);
m_MyIE.Navigate(szCharUrl, NULL, NULL, NULL, NULL);
PostMessage(WM_SIZE,0,0);
ShowWindow(SW_RESTORE);
timeStart = CTime::GetCurrentTime();
//m_MyIE.Navigate(szCharUrl, NULL, NULL, NULL, NULL);
}
return 1;
}