小编Kye*_* Ma的帖子

无法更改MFC按钮标题

int firstButton = IDC_BUTTON1;  

for(int i = firstButton; i < firstButton + 16; ++i)
{
    CWnd *pB = GetDlgItem(i);

    for(int j = 0; j < 16; ++j)
    {

        pB->SetWindowTextW((LPCTSTR)(szTest[j]));
    }
}
Run Code Online (Sandbox Code Playgroud)

我想动态更改按钮标题.

当使用SetWindowTextW与静态文本,如"静态文本",它运作良好,

但是使用char数组(在本例中为szTest),标题不会改变

我编码错误的类型铸件?

c++ mfc

3
推荐指数
1
解决办法
3676
查看次数

标签 统计

c++ ×1

mfc ×1