VS2005使用多字节字符集问题

本文介绍了解决MFC项目中出现的编译错误方法,包括类型转换问题及字符集设置不当导致的错误和警告。通过调整项目属性中的字符集选项可以有效解决这些问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1>------ 已启动生成: 项目: psgdatatotxt, 配置: Debug Win32 ------
1>正在编译...
1>stdafx.cpp
1>正在编译...
1>psgdatatotxt.cpp
1>psgdatatotxtDlg.cpp
1>d:\projects\psgdatatotxt\psgdatatotxt\psgdatatotxtdlg.cpp(59) : error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [3]”转换为“const wchar_t *”
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
1>d:\projects\psgdatatotxt\psgdatatotxt\psgdatatotxtdlg.cpp(167) : error C2664: “atoi”: 不能将参数 1 从“CString”转换为“const char *”
1> 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
1>d:\projects\psgdatatotxt\psgdatatotxt\psgdatatotxtdlg.cpp(182) : warning C4244: “=”: 从“ULONGLONG”转换到“int”,可能丢失数据
1>正在生成代码...
1>生成日志保存在“file://d:\projects\psgdatatotxt\psgdatatotxt\Debug\BuildLog.htm”
1>psgdatatotxt - 2 个错误,1 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========


右击当前项目,选择属性,在项目默认值下面的“字符集”选项改为“使用多字节字符集”就可以了。这是多种编程语言标准不统一造成的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值