当前位置: 首页 > news >正文

MFC工控项目实例二十九主对话框调用子对话框设定参数值

在主对话框调用子对话框设定参数值,使用theApp变量实现。

子对话框各参数变量

   CString    m_strTypeName;    CString    m_strBrand;    CString    m_strRemark;
    double    m_edit_min;    double    m_edit_max;
    double    m_edit_time2;
    double    m_edit_time1;
    double    m_edit_time3;
    DWORD    m_edit_time4;

参考MFC工控项目实例二十七添加产品参数

1、在SEAL_PRESSURE.h中添加代码

class CProductPara
{
public:union{struct{char	m_strTypeName[24];char	m_strBrand[24];			char	m_strRemark[64];double	m_edit_min;double	m_edit_max;double	m_edit_time1;double	m_edit_time2;double	m_edit_time3;double	m_edit_time4;};char len[1024];};
};class CSEAL_PRESSUREApp : public CWinApp
{
public:CSEAL_PRESSUREApp();CString   m_strTypeName;CString   m_strBrand;	CString   m_strRemark;double	m_edit_min;double	m_edit_max;double	m_edit_time1;double	m_edit_time2;double	m_edit_time3;double	m_edit_time4;
...
}

2、在SEAL_PRESSURE.h中添加代码

void CSEAL_PRESSUREDlg::OnTypeChange(UINT nID)
{theApp.m_nProductSel = nID - ID_DEF_PRODUCT+1;CWinApp* pApp = AfxGetApp();int i=pApp->WriteProfileInt("参数","nProductSel1",theApp.m_nProductSel);CString str = theApp.m_allPara[theApp.m_nProductSel].m_strTypeName;theApp.typ_name=theApp.m_DataPath+"\\"+str+"\\";CreateDirectory(theApp.typ_name,FALSE);theApp.m_strTypeName= theApp.m_allPara[theApp.m_nProductSel].m_strTypeName;theApp.m_strBrand= theApp.m_allPara[theApp.m_nProductSel].m_strBrand;theApp.m_strRemark= theApp.m_allPara[theApp.m_nProductSel].m_strRemark;theApp.m_edit_min= theApp.m_allPara[theApp.m_nProductSel].m_edit_min;theApp.m_edit_max= theApp.m_allPara[theApp.m_nProductSel].m_edit_max;theApp.m_edit_time1= theApp.m_allPara[theApp.m_nProductSel].m_edit_time1;theApp.m_edit_time2= theApp.m_allPara[theApp.m_nProductSel].m_edit_time2;theApp.m_edit_time1= theApp.m_allPara[theApp.m_nProductSel].m_edit_time1;theApp.m_edit_time2= theApp.m_allPara[theApp.m_nProductSel].m_edit_time2;theApp.m_edit_time3= theApp.m_allPara[theApp.m_nProductSel].m_edit_time3;theApp.m_edit_time4= theApp.m_allPara[theApp.m_nProductSel].m_edit_time4;SetDlgItemText(IDC_STATIC_TYPNAME,theApp.m_strTypeName);CString str1,str2;str1.Format("%3.2f",theApp.m_edit_min);str2.Format("%3.2f",theApp.m_edit_max);SetDlgItemText(IDC_STATIC100,str1);SetDlgItemText(IDC_STATIC102,str2);if (i!=0){m_TES_START.EnableWindow (1);}}

运行程序

http://www.lryc.cn/news/481252.html

相关文章:

  • Java | Leetcode Java题解之第546题移除盒子
  • 【前端】Svelte:响应性声明
  • PostgreSQL 性能优化全方位指南:深度提升数据库效率
  • Flutter鸿蒙next 使用 BLoC 模式进行状态管理详解
  • Gen-RecSys——一个通过生成和大规模语言模型发展起来的推荐系统
  • Android 重新定义一个广播修改系统时间,避免系统时间混乱
  • 第3章:角色扮演提示-Claude应用开发教程
  • 【FAQ】HarmonyOS SDK 闭源开放能力 —Vision Kit
  • 【问题解决】Tomcat由低于8版本升级到高版本使用Tomcat自带连接池报错无法找到表空间的问题
  • Git LFS
  • 基于Redis缓存机制实现高并发接口调试
  • 数字化转型实践:金蝶云星空与钉钉集成提升企业运营效率
  • Flutter 鸿蒙next 中使用 MobX 进行状态管理
  • 1.62亿元!812个项目立项!上海市2024年度“科技创新行动计划”自然科学基金项目立项
  • Redis数据库测试和缓存穿透、雪崩、击穿
  • [vulnhub] DarkHole: 2
  • 《XGBoost算法的原理推导》12-2 t轮迭代中对样本i的预测值 公式解析
  • ./bin/mindieservice_daemon启动成功
  • Linux: network: ip link M-DOWN的具体含义是什么?
  • Spring中的过滤器和拦截器
  • leetcode20.括号匹配
  • Unity性能优化-具体操作
  • 【嵌入式开发——ARM】1ARM架构
  • Linux中.NET读取excel组件,不会出现The type initializer for ‘Gdip‘ threw an exception异常
  • mmclassification的配置文件样本
  • Java基础——类和对象的定义链表的创建,输出
  • Linux应用项目之量产工具(一)——显示系统
  • Python小白学习教程从入门到入坑------第二十九课 访问模式(语法进阶)
  • 使用 PageHelper 在 Spring Boot 项目中实现分页查询
  • 深度学习-张量相关