本文整理汇总了C++中CEdit::GetLineCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CEdit::GetLineCount方法的具体用法?C++ CEdit::GetLineCount怎么用?C++ CEdit::GetLineCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEdit
的用法示例。
在下文中一共展示了CEdit::GetLineCount方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fopen
MBASEAPI void MIRACLEEXPORT _logDebug(LPCTSTR msg)
{
if(!initlog) logInit();
FILE *f = fopen(strDebugFile,"a+t");
if (f!=NULL)
{
try
{
CTime Time = CTime::GetCurrentTime();
CString TimeStr = Time.Format("%d/%m/%Y-%H:%M:%S:");
fprintf(f,"%s%s \n",TimeStr,msg);
}
catch(...)
{
TRACE0("Error on Log.");
ASSERT(FALSE);
}
fclose(f);
}
TRACE0(msg);TRACE("\n");
if(gwndDebug != NULL)
{
if((gwndDebug->GetSafeHwnd() != NULL) && ::IsWindow(gwndDebug->GetSafeHwnd()))
{
try
{
CString str = msg;
str.Replace(_T("\n"), _T("\r\n"));
if(str.Find('\n')<0)
str +="\r\n";
CString strWndText;
gwndDebug->GetWindowText(strWndText);
strWndText += str;
gwndDebug->SetWindowText(strWndText);
CEdit e;
CRuntimeClass *r = e.GetRuntimeClass();
if(gwndDebug->IsKindOf(r))
{
CEdit *wndEdit = (CEdit*) gwndDebug;
wndEdit->LineScroll(-wndEdit->GetLineCount());
wndEdit->LineScroll(wndEdit->GetLineCount()-4);
}
//gwndDebug->SendMessage(EM_SCROLLCARET);
}
catch (...)
{
//16/11/10 Tarihinde eklendi progrma çýkýþýnda hata vermeyi engellemek için.
gwndDebug = NULL;
}
}
}
}
示例2: appendSent
static void appendSent(CString s)
{
currView->m_ReceiveValue += s;
currView->UpdateData(FALSE);
CEdit *myEdit = (CEdit *)currView->GetDlgItem(IDC_EDRECDATAVALUE);
myEdit->LineScroll(myEdit->GetLineCount());
}
示例3: OnCheckSum
void CMyCommView::OnCheckSum()
{
m_CheckDataStyle = CDSSUM;
m_CheckData.SetWindowText(_T("累加和"));
CString mystr = DoGetReciveSelected();
mystr.TrimLeft(); mystr.TrimRight();
if (mystr == "") return;
char data[512];
int len=DoStr2Hex(mystr,data);
unsigned char *ptemp=(unsigned char*)((LPCTSTR)data);
byte a = DoCheckSum(ptemp,len);
CString myvalue;
myvalue.Format("%x",a);
myvalue.MakeUpper();
if (m_ReceiveValue=="")
m_ReceiveValue = myvalue;
else
m_ReceiveValue += "\r\n" + myvalue;
UpdateData(FALSE);
if(!m_IsShowValueWindow) OnBtvisiblevalue();
CEdit *myEdit = (CEdit *)GetDlgItem(IDC_EDRECDATAVALUE);
myEdit->LineScroll(myEdit->GetLineCount());
}
示例4: OnCheckCrc
void CMyCommView::OnCheckCrc()
{
// TODO: Add your command handler code here
m_CheckDataStyle = CDSCRC;
m_CheckData.SetWindowText(_T("CRC"));
CString mystr = DoGetReciveSelected();
mystr.TrimLeft(); mystr.TrimRight();
if (mystr == "") return;
char data[512];
int len=DoStr2Hex(mystr,data);
unsigned char *ptemp=(unsigned char*)((LPCTSTR)data);
unsigned short cc=DoCreateCRC(ptemp,len);
unsigned short hightbit=cc/256;
unsigned short lowbit = cc-hightbit*256;
CString strHighBit;
strHighBit.Format("%02x",hightbit);
CString strLowBit;
strLowBit.Format("%02x",lowbit);
if (m_ReceiveValue=="")
m_ReceiveValue = strLowBit + ' ' + strHighBit;
else
m_ReceiveValue += "\r\n" + strLowBit + ' ' + strHighBit;
UpdateData(FALSE);
if(!m_IsShowValueWindow) OnBtvisiblevalue();
CEdit *myEdit = (CEdit *)GetDlgItem(IDC_EDRECDATAVALUE);
myEdit->LineScroll(myEdit->GetLineCount());
}
示例5: UpdateLoadLog
//Thread safe way to update the load log
void CLoadLTADlg::UpdateLoadLog()
{
CString sTextToAdd;
g_LoadLogPipeCS.Lock(INFINITE);
sTextToAdd = sm_sLoadLogPipe;
sm_sLoadLogPipe = "";
g_LoadLogPipeCS.Unlock();
if(!sTextToAdd.IsEmpty())
{
CString sLogText;
CEdit* pEdit = ((CEdit*)GetDlgItem(IDC_LOADLOG));
pEdit->GetWindowText(sLogText);
sLogText += sTextToAdd;
pEdit->SetWindowText(sLogText);
pEdit->LineScroll(pEdit->GetLineCount());
}
}
示例6: WriteLog
void CyuchuandemoDlg::WriteLog(int hd,CString WriteLog)
{
CEdit *pEdit;
pEdit = (CEdit *)GetDlgItem(IDC_EDITLOG);
int nLen=0;
nLen = pEdit->GetWindowTextLength ();
pEdit->SetFocus ();
pEdit->SetSel(nLen, nLen);
if (hd==DAS_OK)
WriteLog=WriteLog+" 数据接收正常";
else if (hd==Comm_Init_Err)
WriteLog=WriteLog+" 错误原因:串口初始化错误!";
else if (hd==CommPort_Err)
WriteLog=WriteLog+" 错误原因:端口错误!";
else if (hd==CommPort_Err)
WriteLog=WriteLog+" 错误原因:端口错误!";
else if (hd==Chksum_Err)
WriteLog=WriteLog+" 错误原因:通讯数据效验错误!";
else if (hd==Rev_Data_Err)
WriteLog=WriteLog+" 错误原因:接收数据失败!";
else if (hd==TIME_OUT_Err)
WriteLog=WriteLog+" 错误原因:通讯超时错误!";
else if (hd==Para_Err)
WriteLog=WriteLog+" 错误原因:参数错误!";
else if (hd==Send_Data_Err)
WriteLog=WriteLog+" 错误原因:发送数据失败!";
else if (hd==Get_status_Err)
WriteLog=WriteLog+" 错误原因:接收状态位错误!";
else if ((hd==No_Data_Return)||(hd==No_BIN_Files)||(hd==Read_Files_ERR))
WriteLog=WriteLog+" 错误原因:没有数据返回!";
else if (hd==CRC_ERR)
WriteLog=WriteLog+" 错误原因:CRC效验错误!";
else if (hd==Rev_LEN_Err)
WriteLog=WriteLog+" 错误原因:接收长度溢出!";
else if (hd==Password_Err)
WriteLog=WriteLog+" 错误原因:授权密码错误!";
else if (hd==Password_Para_Err)
WriteLog=WriteLog+" 错误原因:密码格式错误!";
else if (hd==Encrypt_Err)
WriteLog=WriteLog+" 错误原因:数据加密错误!";
else if (hd==Wrong_DEV_Err)
WriteLog=WriteLog+" 错误原因:设备物理ID号不符!";
else if (hd==No_Record_Err)
WriteLog=WriteLog+" 错误原因:没有流水!";
else
WriteLog=WriteLog+" ";
WriteLog = WriteLog+"\r\n";
pEdit->ReplaceSel (WriteLog);
nLen = pEdit->GetLineCount();
//pEdit->LineScroll(nLen, nLen);
//pEdit->SendMessage(WM_VSCROLL, MAKEWPARAM(SB_BOTTOM,0),0);
if( nLen >= 150 )
{
pEdit->SetWindowText("");
}
}
示例7: Py_BuildValue
// @pymethod int|PyCEdit|GetLineCount|Gets the number of lines in an edit control.
static PyObject *
PyCEdit_get_line_count(PyObject *self, PyObject *args)
{
CHECK_NO_ARGS(args);
CEdit *pEdit = GetEditCtrl(self);
if (!pEdit )
return NULL;
GUI_BGN_SAVE;
int rc = pEdit->GetLineCount();
GUI_END_SAVE;
return Py_BuildValue("i", rc); // @pyseemfc CEdit|GetLineCount
// @rdesc The number of lines in the buffer. If the control is empty, the return value is 1.
}
示例8: GetCDInfo
/**
* Gets change directory info from previous lines, feature only
* for cmdl and compiler tab, all other tabs return sFile unchanged.
*
* @param iLine: zero based line index from where to
* search cd [path] commands backward until
* first line or cd <fullpath> or special cd $(prjdir)
* is found
* @param editCtrl: holds the text data
* @param sFile: in/out. gets updated to point to final path
* @param (HACK) pMsgFrame: CMsgFrame, used to check if cmdl, compiler tab
* @param (HACK) pDoc: CMsgDoc, used to check if cmdl, compiler tab
* may still be a (project) relative path on exit.
* @see -
*/
static void GetCDInfo(int iLine, CEdit& editCtrl, CString& sFile, CMsgFrame* pMsgFrame, CMsgDoc* pDoc)
{
int nLen;
const TCHAR* pszDir;
TCHAR buffer[2*MAX_PATH];
if(FC_StringIsAbsPath(sFile))
return;
if(iLine >= editCtrl.GetLineCount())
return;
//feature only for compiler tab (HACK):
ASSERT (pMsgFrame != NULL);
if (!pMsgFrame)
return;
int iIndex=-1;
pMsgFrame->m_tabWnd.GetActiveTab(iIndex);
if(!pDoc || iIndex<0 || iIndex >= pDoc->m_arrMsgData.GetSize())
{
ASSERT (!"bad pDoc, iIndex");
return;
}
MSG_VIEWER_TYPE msgTyp = pDoc->m_arrMsgData[iIndex].m_MsgViewerType;
if(msgTyp != MSG_CmdLineMsgViewer && msgTyp != MSG_CompileMsgViewer)
return;
while(iLine>=0)
{
nLen = editCtrl.GetLine(iLine, buffer, FC_ARRAY_LEN(buffer)-10);
iLine--;
if(nLen<=0)
continue;
buffer[nLen] = 0;//<-needed ?
FC_StringTrim(buffer);
if((pszDir = IsLineCDInfo(buffer)) != NULL)
{
if(!*pszDir)
break;//cd $(prjdir): don't prepend default prj dir as an abs path to sFile
//all other rel or abs cd commands must be prepended:
sFile.Insert(0, '\\');
sFile.Insert(0, pszDir);
//if is abs must stop here:
if(FC_StringIsAbsPath(pszDir))
break;
}
}
}
示例9: AddString
void CSmartCommunicationDlg::AddString(CString csAppend,bool bFlag)
{
if( m_check_stop.GetCheck()) return ;
if( csAppend.IsEmpty() ) return ;
CEdit *pEdit;
pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
int nLen=0;
nLen = pEdit->GetWindowTextLength ();
pEdit->SetFocus ();
pEdit->SetSel(nLen, nLen);
csAppend = csAppend+"\r\n";
pEdit->ReplaceSel (csAppend);
nLen = pEdit->GetLineCount();
if( nLen >= 150 )
{
pEdit->SetWindowText("");
}
}
示例10: ReportMessageWrite
void CAgentMonitorDlg::ReportMessageWrite(LPCTSTR pMsg)
{
CString s, sLog;
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT2);
pEdit->GetWindowText(sLog);
if (sLog.IsEmpty())
{
s = pMsg;
}
else
{
s.Format(_T("\r\n%s"), pMsg);
}
sLog += s;
pEdit->SetWindowText(sLog);
pEdit->LineScroll(pEdit->GetLineCount());
}
示例11: showlog
void CLogView::showlog(WPARAM wParam, LPARAM lParam)
{
UINT nlength = (UINT)wParam;
CString log =(char*)lParam;
char tmpstr[100];
CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
UpdateData(TRUE);
m_log+=log;
if (m_log.GetLength()>2048)
{
m_log = m_log.Right(1024);//先去掉512字节
UpdateData(FALSE);
pEdit->GetLine(0,tmpstr,100);
int nlength = strlen(tmpstr); //得到可能乱码的长度
m_log = m_log.Right(1024-nlength);//去掉nlength长度
}
UpdateData(FALSE);
pEdit->LineScroll(pEdit->GetLineCount(),0);
delete (char*)lParam;
lParam =NULL;
}
示例12: wudp
//.........这里部分代码省略.........
break;
}
bstrT = wudp->NumToStrHex(recIndex, 4);
strTemp = "8D10" + CString(bstrT);
bstrCmd = wudp ->CreateBstrCommand(controllerSN, A2BSTR(strTemp)) ; //生成指令帧
wserial->serial_comm(bstrCmd, bstrComPort,&bstrFrame); //发送指令, 并获取返回信息
wserial->get_ErrCode((long*)&lngRetSerial);
if (( ERROR_SUCCESS != lngRetSerial)||(CString(bstrFrame)=="" ) )
{
//没有收到数据,
//失败处理代码... (查ErrCode针对性分析处理)
//用户可考虑重试
strInfo = strInfo + char(13) + char(10) + "提取记录出错" ;
pBoxOne->SetWindowText(strInfo );
break;
}
else
{
bstrSwipeDate = wudp->GetSwipeDateFromRunInfo(bstrFrame, &cardId, &status) ;
if (CString((bstrSwipeDate)) != "" )
{
strRunDetail = "";
strTemp.Format( "%ld",cardId);
strRunDetail = strRunDetail + "卡号: " + strTemp ;
strTemp.Format( "%ld",status);
strRunDetail = strRunDetail + char(9) + " 状态:" + char(9) + strTemp ;
bstrT = wudp->NumToStrHex(status,1);
strRunDetail = strRunDetail + "(" + CString(bstrT) + ")" ;
strRunDetail = strRunDetail + char(9) + "时间:" + char(9) + CString(bstrSwipeDate) ;
strInfo = strInfo + char(13) + char(10) + strRunDetail ;
recIndex = recIndex + 1; //下一条记录
pBoxOne->SetWindowText(strInfo );
pBoxOne->LineScroll(pBoxOne->GetLineCount()); //显示最后一行
}
else
{
strTemp.Format("%ld", (recIndex-1));
strInfo = strInfo + char(13) + char(10) + "提取记录完成. 总共提取记录数 =" + strTemp;
pBoxOne->SetWindowText(strInfo );
pBoxOne->LineScroll(pBoxOne->GetLineCount()); //显示最后一行
break;
}
}
if(::PeekMessage (&message,NULL,0,0,PM_REMOVE)){ //响应其他事件 如Exit按钮操作
::TranslateMessage (&message);
::DispatchMessage (&message);
}
}
if (( ERROR_SUCCESS != lngRetSerial)||(CString(bstrFrame)=="" ) )
{
break; //出错 退出
}
//删除已提取的记录
if (recIndex > 1) //只有提取了记录才进行删除
{
strTemp.Format("%ld", (recIndex-1));
strTemp = "是否删除控制器上已提取的记录: " + strTemp;
if (::MessageBox(NULL,(LPCTSTR)strTemp,"删除",MB_YESNO ) == IDYES)
{
bstrT = wudp->NumToStrHex(recIndex-1, 4);
strTemp = "8E10" + CString(bstrT);
bstrCmd = wudp ->CreateBstrCommand(controllerSN, A2BSTR(strTemp)) ; //生成指令帧