在vc中用纯windows编程非MFC,如何把数组中的元素显示在静态文本框中

2024-11-30 06:00:27
推荐回答(2个)
回答1:

HWND h = 文件框窗口的hwnd
char buff[4096];
char tmpbuff[32];
buff[0] = 0;
for(int i = 0;i{
itoa(tmpbuff,data[0],10);
strcat(buff,tmpbuff);
strcat(buff,',');
}
buff[strlen(buff)] = 0;
SetWindowText(h,buff,strlen(buff));

回答2:

用函数_itot将数字转换为unicode串sz,然后
SetWindowText(GetDlgItem(hDlg,nID),sz);
hDlg是对话框句柄,nID是你静态文本框ID