当前位置:网站首页>MFC handy notes
MFC handy notes
2022-07-26 09:33:00 【Flying 123_ one hundred and twenty-three】
1、cstring go to char*
CString strPort;
USES_CONVERSION;
char* port = (LPSTR)(LPCSTR)strPort; //cstring go to char*
2、 obtain combo box Information about
CString strPort;
CComboBox* pComboPort = (CComboBox*)GetDlgItem(IDC_COMBO_PORT);
pComboPort->GetWindowText(strPort);
3、 Get and set button Information on the button
CString str;
GetDlgItemText(IDC_BUTTON_OPEN, str);// Get the information on the button
CButton* pBtnOpen = (CButton*)GetDlgItem(IDC_BUTTON_OPEN);
pBtnOpen->SetWindowText(_T(" close "));// Set the information on the button
4、 Set up button
GetDlgItem(IDC_BUT_RunStatus)->EnableWindow(FALSE);// Turn grey , Unavailable , so
GetDlgItem(IDC_BUT_RunStatus)->EnableWindow(TRUE);// Restore to normal , You can use , so
5、String It's transformed into int type
int m_Index;
CString index;
m_Index = _ttoi(index);
6、C***Dialog Call the master C***View
1) add to #include "C***Doc.h" And #include "C***View.h" The header file
2)C***Dialog Add in CView Base class pointer m_pView.
3)C**View Created in Dialog Time assignment C***Dialog.m_pView=this
4)C***Dialog Call in function ((C***View)*m_pView)->Function();
边栏推荐
猜你喜欢
随机推荐
What is asynchronous operation
PMM(Percona Monitoring and Management )安装记录
添加dll
v-premission添加权限
大二上第三周学习笔记
mysql5.7.25主从复制(单向)
Mo team learning notes (I)
Byte buffer stream & character stream explanation
js中树与数组的相互转化(树的子节点若为空隐藏children字段)
Table extraction for opencv table recognition (2)
面试题目大赏
Process32First返回false,错误x信息24
模板(三)
音视频知识
(二)面扫描仪与机械臂的手眼标定(眼在手外:九点标定)
The difference between thread join and object wait
v-for动态设置img的src
网络流学习笔记
QT随手笔记(六)——更新界面、截图、文件对话框
JS 连等赋值操作