当前位置:网站首页>mfc随手笔记
mfc随手笔记
2022-07-26 09:28:00 【飞扬123_123】
1、cstring转到char*
CString strPort;
USES_CONVERSION;
char* port = (LPSTR)(LPCSTR)strPort; //cstring转到char*
2、 获取combo box的信息
CString strPort;
CComboBox* pComboPort = (CComboBox*)GetDlgItem(IDC_COMBO_PORT);
pComboPort->GetWindowText(strPort);
3、获取和设置button按钮上的信息
CString str;
GetDlgItemText(IDC_BUTTON_OPEN, str);//获取按钮上的信息
CButton* pBtnOpen = (CButton*)GetDlgItem(IDC_BUTTON_OPEN);
pBtnOpen->SetWindowText(_T("关闭"));//设置按钮上的信息
4、设置button
GetDlgItem(IDC_BUT_RunStatus)->EnableWindow(FALSE);//变灰,不可用,可见
GetDlgItem(IDC_BUT_RunStatus)->EnableWindow(TRUE);//还原正常,可用,可见
5、String 型转化成 int 型
int m_Index;
CString index;
m_Index = _ttoi(index);
6、C***Dialog调用主C***View
1)添加#include "C***Doc.h"与#include "C***View.h"头文件
2)C***Dialog里加入CView 基类指针m_pView。
3)C**View中创建Dialog时赋值C***Dialog.m_pView=this
4)C***Dialog函数中调用((C***View)*m_pView)->Function();
边栏推荐
- Simple pedestrian recognition code to 88% accuracy Zheng Zhedong preparation
- 附加到进程之后,断点显示“当前不会命中断点 还没有为该文档加载任何符号”
- v-premission添加权限
- ZXing简化版,转载
- 解决“NOTE: One or more layouts are missing the layout_width or layout_height attributes.”
- 微信小程序图片无法显示时显示默认图片
- Zipkin installation and use
- OnTap 9 file system limitations
- [Online deadlock analysis] by index_ Deadlock event caused by merge
- V-for dynamically sets the SRC of img
猜你喜欢
matlab中的AR模型短时预测交通流
el-table实现增加/删除行,某参数跟着变
异常处理机制二
Personality test system V1.0
2022 mobile crane driver test question simulation test question bank simulation test platform operation
配置ADCS后访问certsrv的问题
[Online deadlock analysis] by index_ Deadlock event caused by merge
cocoapods的安装和使用
volatile 靠的是MESI协议解决可见性问题?(上)
Cat installation and use
随机推荐
malloc分配空间失败,并且不返回null
PHP一次请求生命周期
音视频知识
【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)
tabbarController的使用
Paper notes: knowledge map kgat (unfinished temporary storage)
Mysql事务
微信小程序AvatarCropper 头像裁剪
面试题目大赏
[online problem] timeout waiting for connection from pool problem troubleshooting
[MySQL] detailed explanation of redo log, undo log and binlog (4)
Add DLL
Exception handling mechanism II
如何添加一个PDB
ZXing简化版,转载
[arkit, realitykit] turn pictures into 3D models
What is asynchronous operation
Use of off heap memory
Sliding window, double pointer, monotone queue, monotone stack
VectorTileLayer更换style