在对话框里建了一个 EDIT BOX 和一个 BUTTON在BUTTON 的 单击事件中加了如下代码 CString strText;
GetDlgItemText(IDC_EDIT2,strText);
int time;
time = atoi(strText);
::MessageBox(NULL,NULL,NULL,time);运行程序以后,没有收到MESSAGEBOX的消息,为什么呢??
GetDlgItemText(IDC_EDIT2,strText);
int time;
time = atoi(strText);
::MessageBox(NULL,NULL,NULL,time);运行程序以后,没有收到MESSAGEBOX的消息,为什么呢??
解决方案 »
- DAO连接数据库,提示数据库格式不可识别?
- PrepCache()函数谁知道怎么用,怎么在MSDN中找不到?
- 参数register unsigned long *from 是什么意思?
- list控件有没有根据item定显示的行数,而不根据控件的尺寸
- 初学者的小问题,大家看看,先谢谢了!
- 散分100:哪位有这个头文件?
- 关于对象池的一个问题????
- mfc 遍历网页元素奇怪的问题?
- 提议:成立北京市程序员联盟/俱乐部(北京程序员之家),为北京程序员服务,请大家各抒己见!
- 我对Presubclasswindow()的用途还很模糊,请高人指点迷津
- 在我自己定义的类中怎么获得视类窗口的指针?
- 怎样在对话框的picture控件中加载bmp,jpg格式的图片
错误信息如下
cannot convert parameter 2 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
UpdateData(TRUE);
吧
要是用这个看看
UpdateData(TRUE);
::MessageBox(NULL,m_time,NULL,MB_OK);
------ 以下是签名 ------
SoftDN.com, 提供免费的项目管理平台:SVN仓库、需求管理、BUG跟踪、任务管理、在线论坛、网站空间、项目存储及完整的备份等。欢迎网友光临建立项目,开创自己的梦想。
地址:http://www.softdn.com http://www.softdn.cn
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast是不是MESSAGEBOX不能显示 INT类型的变量??
str.Format("%d",m_time );
::MessageBox(NULL,str,NULL,MB_OK);
MessageBox(m_time);
试过了可以
::messagebox(abc);这个都是不可以的。。
temp.Format("%d",m_time);
转换成 CString 在用MessageBox(temp);显示