标题:VS2005编译出错,请问这是为什么
取消只看楼主
pxy94
Rank: 2
等 级:论坛游民
帖 子:59
专家分:20
注 册:2007-6-7
结帖率:100%
 问题点数:0 回复次数:1 
VS2005编译出错,请问这是为什么
char buf[10];
num2.GetWindowTextW(buf,10);
错误提示为:
错误    1 error C2664: 'int CWnd::GetWindowTextW(LPTSTR,int) const' : cannot convert parameter 1 from 'char [10]' to 'LPTSTR'    e:\my documents\visual studio 2005\projects\mfc\mfc\mfcdlg.cpp    163
搜索更多相关主题的帖子: 编译 mfc int LPTSTR buf 
2008-04-10 17:00
pxy94
Rank: 2
等 级:论坛游民
帖 子:59
专家分:20
注 册:2007-6-7
得分:0 
[bo]以下是引用 [un]flyue[/un] 在 2008-4-20 17:55 的发言:[/bo]

char buf[10];
num2.GetWindowTextW((LPTSTR)buf,10);
试试

谢谢指点,用你的方法和把char改为TCHAR都可以,这是宽字符的问题

[[it] 本帖最后由 pxy94 于 2008-4-22 16:16 编辑 [/it]]

向大家学习!
2008-04-22 16:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-208236-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.384357 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved