error:MultiByteToWideChar cannot convert parameter 2 from 'char [10]' to 'unsigned short *'
2014-06-05 12:13
621 查看
前提是#include<windows.h>
MultiByteToWideChar(CP_ACP,0,RootDirectory,-1,wRootDirectory,10)
以上语句容易出现以上错误cannot convert parameter 5 from 'char [10]' to 'unsigned short *',修改的最直接的方法就是强制转换:
MultiByteToWideChar(CP_ACP,0,RootDirectory,-1,(unsigned short*)wRootDirectory,10)
MultiByteToWideChar(CP_ACP,0,RootDirectory,-1,wRootDirectory,10)
以上语句容易出现以上错误cannot convert parameter 5 from 'char [10]' to 'unsigned short *',修改的最直接的方法就是强制转换:
MultiByteToWideChar(CP_ACP,0,RootDirectory,-1,(unsigned short*)wRootDirectory,10)
相关文章推荐
- 报错 error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'unsigned short [10]' to 'const char *'
- error:cannot convert parameter 1 from 'unsigned char *' to 'char *'
- vc++控件变量SetDlgItemText(): cannot convert parameter 1 from 'char [10]' to ‘
- LoadCursorA' : cannot convert parameter 2 from 'const int' to 'const char *
- cannot convert parameter 5 from 'char [64]' to 'unsigned char *解决办法
- error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [20]' to 'LPCWSTR' 原因
- cannot convert parameter 1 from 'char *' to 'LPCWSTR'
- Unicode字符集与多字节字符集的比较(解决“cannot convert parameter 1 from 'char []' to 'LPCWSTR'”)
- Unicode字符集与多字节字符集的比较(解决“cannot convert parameter 1 from 'char []' to 'LPCWSTR'”)
- 类型转换 -- 使用Unicode下的cannot convert parameter 1 from 'CString' to 'const char *' 解决办法
- GetWindowTextW(LPTSTR,int) const' :cannot convert parameter 1 from 'char[10]
- error C2664:cannot convert parameter 2 from 'char [260]' to 'LPWCH'
- error C2664: 'CWnd::MessageBoxW' : cannot convert parameter 1 from 'char *' to 'LPCTSTR'的解决方法
- cannot convert parameter 1 from 'CString' to 'const char *'
- cannot convert parameter 1 from 'const char *' to 'LPCWSTR
- vs2008下cannot convert parameter 1 from 'LPCTSTR' to 'const char *'的解决方法
- VS2008中报错:cannot convert parameter 2 from 'char *' to 'LPCWSTR'
- error:error C2664: 'calc' : cannot convert parameter 2 from 'int' to 'int []' Conversion fro
- 'LoadLibraryW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR' 解决方案
- 使用atoi 报错:cannot convert parameter 1 from '_TCHAR *' to 'const char *'