| 发表于:2007-06-26 08:22:00 楼主 |
请看以下代码,m_orderno为文本框的映射变量,类型为cstring, m_preproduceamount是cintedit类的映射变量,类型为控件,cintedit是自定义的,派生于文本框类 问题:在执行m_preproduceamount.setwindowtext( "111 ")后,m_orderno的值变成空字符串了,真是百思不得其解。 m_orderno= "111 "; m_preproduceamount.setwindowtext( "111 "); cintedit的源文件 void cintedit::onchar(uint nchar, uint nrepcnt, uint nflags) { // todo: add your message handler code here and/or call default if ((nchar> =48 && nchar <=57) ¦ ¦ nchar==8 ¦ ¦ nchar==13) { cedit::onchar(nchar, nrepcnt, nflags); } else { afxmessagebox( "请输入整数! "); } } |
|
|
|
|