如何获取在编辑框中输入的数据? [英] How to get the data entered in an edit box?

查看:96
本文介绍了如何获取在编辑框中输入的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CString lpstring;
    m_cedit.GetWindowText(lpstring.GetBuffer(),20);
	EndDialog(IDD_EDITBOX_DIALOG);
    lpstring.ReleaseBuffer();


我已经在OnOk() 函数中尝试过此操作,因为我想将此值保存在数据库中.但是我在运行程序时遇到一些错误,例如调试断言错误.


I have tried this in the OnOk() function because I want to save this value in the database. But I am getting some error while I am running the program like Debug assertion error.

推荐答案

您应该在对话框中使用类变量和CDialog类的DoDataExchange方法中的DDX宏.请参见此处 [
You should use the class variables in your dialog and the DDX macros in the DoDataExchange method of your CDialog class. See here[^] for further information.


这篇关于如何获取在编辑框中输入的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆