博客
关于我
MFC:把登录界面的用户信息传回主界面
阅读量:140 次
发布时间:2019-02-28

本文共 533 字,大约阅读时间需要 1 分钟。

首先,登陆界面肯定是写在主界面的初始化中的,登陆界面用模态对话框,这样具有阻塞功能,在登录框没有注销之前,是不会运行主界面其他程序的,当用户名和密码匹配时,销毁登录对话框

主界面OnInitDialog()函数

LOGIN dlg_login;    //建立登陆对话框对象	dlg_login.DoModal();usernameTrans = dlg_login.usernameTrans;//usernameTrans 是主界面类的一个属性,用于接收登录对话框传进来的dlg_login.usernameTrans;

登录界面传值操作

//判断账号密码是否一致							if (m_name == UserNameEN && m_pwd == UserPassEN)				{   					//MessageBox(_T("登录成功!", "提示"));					usernameTrans = m_name;				//usernameTrans 是登录对话框类的一个属性,当用户名密码匹配,把用户名赋值给这个属性					//myFontuserName = m_name;									CDialog::OnOK();//销毁登录框				}

转载地址:http://miyc.baihongyu.com/

你可能感兴趣的文章
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>