当前位置:网站首页>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();
边栏推荐
猜你喜欢
Fiddler下载安装
MySQL transaction
[Online deadlock analysis] by index_ Deadlock event caused by merge
Neural network and deep learning-6-support vector machine 1-pytorch
Object 的Wait Notify NotifyAll 源码解析
After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
V-permission add permission
Zxing simplified version, reprinted
登录模块用例编写
2022 Shanghai safety officer C certificate examination questions and mock examination
随机推荐
[MySQL] detailed explanation of MySQL lock (III)
TabbarController的封装
keepalived 实现mysql自动故障切换
微信小程序开发
matlab中的AR模型短时预测交通流
LeetCode三数之和问题
使用openLayer画箭头
Windows通过命令备份数据库到本地
点击input时,不显示边框!
OnTap 9 file system limitations
性格测试系统v1.0
Exception handling mechanism II
V-for dynamically sets the SRC of img
2022 Shanghai safety officer C certificate examination questions and mock examination
js在控制台输出菱形
配置ADCS后访问certsrv的问题
arcgis的基本使用1
MySql5.7.25源码安装记录
字节缓冲流&字符流详解
Bloom filter