2010-11-19 36 views
1

如何在Visual C++中設置文本框的值? 我一直在嘗試以下行strTemp.Format(「%d」,nNbr);不編譯 感謝如何在Visual C++中設置文本框的值

 int nNbr = 5; 
    CString strTemp; 
    strTemp.Format("%d", nNbr); 

    textBox.SetWindowTextW(strTemp); 

回答

1

您可能需要使用_T宏以支持ANSIUNICODE構建應用程序的:

int nNbr = 5; 
CString strTemp; 
strTemp.Format(_T("%d"), nNbr); 
textBox.SetWindowText(strTemp); 
相關問題