• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

connect the dots

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

cannot convert parameter 1 from 'const char *' to 'LPCWSTR' 修改

    想要搜索文件夹目录下所有文件,网上搜了个例子,

string find_path;

WIN32_FIND_DATA FindFileData;

hFind = FindFirstFile(find_path.c_str(), &FindFileData);

 

提示错误,cannot convert parameter 1 from 'const char *' to 'LPCWSTR' 修改 ,搜索解决方法:

    Change your project configuration to use multibyte strings. Press ALT+F7 to open the properties, and navigate to Configuration Properties > General. Switch Character Set to "Use Multi-Byte Character Set".

 

“但是如果是变量,不是常量字符串的话,就还是会有问题。最痛快的办法就是在建立工程时,直接选不用那个Use Unicode libraries ,这样就不会再遇到这个问题了。” 这个还没遇到,在遇到问题再解决!

posted on 2014-04-30 10:14  nimo299  阅读(687)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3