char ch1[10],ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowTextW (ch1,10);error C2664: “int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转换为“LPTSTR”错误是因为GetWindowTextW()第一个参数要是LPTSTR类型要怎么转换?
GetDlgItem(IDC_EDIT1)->GetWindowTextW (ch1,10);error C2664: “int CWnd::GetWindowTextW(LPTSTR,int) const”: 不能将参数 1 从“char [10]”转换为“LPTSTR”错误是因为GetWindowTextW()第一个参数要是LPTSTR类型要怎么转换?
int num1,num2,num3;
char ch1[10],ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowTextW ((LPTSTR)ch1,10);
GetDlgItem(IDC_EDIT2)->GetWindowTextW ((LPTSTR)ch2,10);
num1=atoi(ch1);
num2=atoi(ch2);
num3=num1=num2;
itoa(num3,ch3,10);
GetDlgItem(IDC_EDIT3)->SetWindowTextW((LPTSTR)ch3);
你在什么环境下做的,这是UNICODE版本的
TCHAR ch1[10],ch2[10],ch3[10];
GetDlgItem(IDC_EDIT1)->GetWindowText((LPTSTR)ch1,10);
TCHAR ch1[10],ch2[10],ch3[10];
memset(ch1, 0, 10 * sizeof(TCHAR));
memset(ch2, 0, 10 * sizeof(TCHAR));
memset(ch3, 0, 10 * sizeof(TCHAR));
GetDlgItem(IDC_EDIT1)->GetWindowText((LPTSTR)ch1,10);
请参考http://www.sgxcn.com/doc/show.asp?ID=322
而char* = LPSTR
TCHAR在定义了Unicode后等价于wchar_t,没有定义Unicode时等价于char。
UNICODE版本下面最好用TCHAR宽字符类型~~~
什么意思??
MSDN2005里面没有索引查找吗??