zoukankan      html  css  js  c++  java
  • error C2440: “=”: 无法从“const char [11]”转换为“LPCWSTR”

    错误 1 error C2440: “=”: 无法从“const char [11]”转换为“LPCWSTR”
    错误 2 error C2664: “CreateWindowExW”: 不能将参数 2 从“const char [11]”转换为“LPCWSTR”
    错误 3 error C2664: “MessageBoxW”: 不能将参数 2 从“char [20]”转换为“LPCWSTR”
    错误 4 error C2664: “MessageBoxW”: 不能将参数 2 从“const char [14]”转换为“LPCWSTR”
    错误 5 error C2664: “TextOutW”: 不能将参数 4 从“const char [19]”转换为“LPCWSTR”
    错误 6 error C2664: “TextOutW”: 不能将参数 4 从“const char [9]”转换为“LPCWSTR”
    错误 7 error C2664: “MessageBoxW”: 不能将参数 2 从“const char [15]”转换为“LPCWSTR”
    8 IntelliSense: 不能将 "const char *" 类型的值分配到 "LPCWSTR" 类型的实体
    9 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    10 IntelliSense: "char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    11 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    12 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    13 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    14 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    15 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容
    16 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容

    17 IntelliSense: "const char *" 类型的实参与 "LPCWSTR" 类型的形参不兼容

    出现上述错误的原因是创建项目时,默认设置的字符集为Unicode,改为使用多字符集就可以:

    右键单击项目,选择“属性“->"配置属性"->"常规"->"字符集",更改为使用多字符集。

  • 相关阅读:
    关于vue2.x使用axios以及http-proxy-middleware代理处理跨域的问题
    vue-resource的使用
    从头开始开发一个vue幻灯片组件
    图与例解读Async/Await
    浅谈web缓存
    APICloud框架——总结一下最近开发APP遇到的一些问题 (三)
    编写现代 CSS 代码的 20 个建议
    仿微信联系人列表滑动字母索引
    初来乍到,向各位大牛虚心学习
    转发80端口的脚本
  • 原文地址:https://www.cnblogs.com/AlexanderZhao/p/12879007.html
Copyright © 2011-2022 走看看