无法将参数 1 从“char ”转换为“LPWSTR”
来源:互联网 发布:淘宝客服绩效管理 编辑:程序博客网 时间:2024/05/15 18:43
#include<iostream>
#include<Windows.h>
using namespace std;
int main()
{
//自身程序的路径
char selfFilename[MAX_PATH] = { 0 };
//系统目录的路径
char WindowsPath[MAX_PATH] = { 0 };
//临时路径变量
char TmpPath[MAX_PATH] = { 0 };
GetModuleFileName(nullptr, selfFilename, MAX_PATH);
GetWindowsDirectory(WindowsPath, MAX_PATH);
}
因为用到Windows底层的API。照着书上打的,可是报了一个错 无法将参数 1 从“char ”转换为“LPWSTR”
解决方法 工程右键属性->常规->字符集->使用多字节字符集
0 0
- 无法将参数 1 从“char ”转换为“LPWSTR”
- BOOL CreateProcessW: 无法将参数 2 从“char [4]”转换为“LPWSTR” 错误的解决方法
- 不能将参数 2 从“char [256]”转换为“LPWSTR”
- error C2664: “wsprintfW”: 不能将参数 1 从“char [32]”转换为“LPWSTR” 1>
- “strcmp”: 不能将参数 1 从“LPWSTR”转换为“const char *”
- error C2664: “GetModuleFileNameW”: 不能将参数 2 从“char [260]”转换为“LPWSTR”
- error C2664: “GetModuleFileNameW”: 不能将参数 2 从“char [260]”转换为“LPWSTR”
- “GetModuleFileNameW”: 不能将参数 2 从“char [260]”转换为“LPWSTR”
- 【L“”】无法将参数从“const char”转换为“LPCWSTR”
- VS2013 error C2664: “FILE *fopen(const char *,const char *)”: 无法将参数 1 从“LPCTSTR”转换为“const char *”
- ClientSysDlg.cpp(166) error C2664 “int atoi(const char )” 无法将参数 1 从“CString”转换为“const char ”
- char[] 转换为LPWSTR
- 不能将参数 1 从“char [10]”转换为“LPTSTR”
- 不能将参数1从“const char []”转换为“LPCTSTR
- 不能将参数1从“const char []”转换为“LPCTSTR
- 不能将参数 1 从“CString”转换为“const char *”
- 不能将参数1从“CString”转换为“const char *”
- 不能将参数 1 从“CString”转换为“const char *”
- Robot framework中元素的定位
- 三层架构
- poj1434Fill the Cisterns!【二分+计算几何】
- iOS 手势识别与操作 UIGestureRecognizer
- c/c++ sort函数的用法
- 无法将参数 1 从“char ”转换为“LPWSTR”
- 使用MSScriptControl 在 C# 中读取json数据
- 个人学习过程中遇到的疑难杂症(笔记,持续更新中……)
- IP地址、子网掩码、网络号、主机号、网络地址、主机地址
- 搭建Spring、Spring MVC、Mybatis和Freemarker
- android ViewGroup的事件分发机制
- 前端相关-代码自动补全
- JDBC数据库操作
- 一类常见的矩阵快速幂题型 总结