我在WM_COMMAND下写的
POINT pt,pp;
char sz[10];
pt.x =100;
pt.y =300;
pp.x =500;
pp.y =500;
SetWindowText(hE1,itoa(pt.x ,sz,10));
SetWindowText(hE2,itoa(pt.y ,sz,10));
SetWindowText(hE3,itoa(pp.x ,sz,10));
SetWindowText(hE4,itoa(pp.y ,sz,10));
hE1,hE2,hE3,hE4分别为4个edit文本框的句柄,
我想单击按钮后,把pt,pp两个点的坐标显示到4个文本框中,自己试着用setwindowtext函数,不会用。。
不知道我是漏了什么,还是写错了,谁能告诉我怎么改?
POINT pt,pp;
char sz[10];
pt.x =100;
pt.y =300;
pp.x =500;
pp.y =500;
SetWindowText(hE1,itoa(pt.x ,sz,10));
SetWindowText(hE2,itoa(pt.y ,sz,10));
SetWindowText(hE3,itoa(pp.x ,sz,10));
SetWindowText(hE4,itoa(pp.y ,sz,10));
hE1,hE2,hE3,hE4分别为4个edit文本框的句柄,
我想单击按钮后,把pt,pp两个点的坐标显示到4个文本框中,自己试着用setwindowtext函数,不会用。。
不知道我是漏了什么,还是写错了,谁能告诉我怎么改?
另外的EDIT控件 一样的方式
::SetWindowText(hE1,itoa(pt.x ,sz,10));
::SetWindowText(hE2,itoa(pt.y ,sz,10));
::SetWindowText(hE3,itoa(pp.x ,sz,10));
::SetWindowText(hE4,itoa(pp.y ,sz,10));
在前面加两个冒号 使用全局函数
否则CWnd类下的SetWindowText是不能使用两个参数的,会报错
m_btn.m_btn.SetWindowText(hE1,itoa(pt.x ,sz,10));要这么调用
我在上面语句后面加上画线的函数,单机按钮后,能出现两点间的线段,就是编辑框始终是空的,
unused CXX0030:Error:Expression can not be evaluated