积极答复者
cannot convert parameter 1 from 'char [10]' to 'LPTSTR'

问题
-
int num1,num2,num3;
char ch1[10], ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowTextW(ch1,10);
GetDlgItem(IDC_EDIT2)->GetWindowTextW(ch2,10);
num1=atoi(ch1);
num2=atoi(ch2);
num3=num1+num2;
itoa(num3,ch3,10);
GetDlgItem(IDC_EDIT3)->SetWindowTextW(ch3,10);报错如下'int CWnd::GetWindowTextW(LPTSTR,int) const' : cannot convert parameter 1 from 'char [10]' to 'LPTSTR'
帮我把代码改改,谢谢了
- 已编辑 Sheng Jiang 蒋晟Moderator 2010年11月16日 19:57 标题含糊
答案
-
你的代码不支持Unicode。
char->TCHAR
itoa->_itot
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 Daoping Liu - MSFTModerator 2010年11月23日 10:51
全部回复
-
你的代码不支持Unicode。
char->TCHAR
itoa->_itot
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 Daoping Liu - MSFTModerator 2010年11月23日 10:51