报错 error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'unsigned short [10]' to 'const char *'
2011-01-03 13:21
801 查看
//创建窗口
HWND hWnd = CreateWindow( L"ClassName", "三维字体",
WS_OVERLAPPEDWINDOW, 200, 100, 600,500,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
报错
error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'unsigned short [10]' to 'const char *'
因为这段代码是在 vs2005写的 在vc6
去掉“L”
//创建窗口
HWND hWnd = CreateWindow( "ClassName", "三维字体",
WS_OVERLAPPEDWINDOW, 200, 100, 600,500,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
HWND hWnd = CreateWindow( L"ClassName", "三维字体",
WS_OVERLAPPEDWINDOW, 200, 100, 600,500,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
报错
error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'unsigned short [10]' to 'const char *'
因为这段代码是在 vs2005写的 在vc6
去掉“L”
//创建窗口
HWND hWnd = CreateWindow( "ClassName", "三维字体",
WS_OVERLAPPEDWINDOW, 200, 100, 600,500,
GetDesktopWindow(), NULL, wc.hInstance, NULL );
相关文章推荐
- 报错 error C2664: 'CreateWindowExA' : cannot convert parameter 2 from 'unsigned short [10]' to 'const char *'
- error C2664: 'atof' : cannot convert parameter 1 from 'int' to 'const char *'
- error C2664: 'atoi' : cannot convert parameter 1 from 'CString' to 'const char *'
- error C2664: 'TextOutW' : cannot convert parameter 4 from const char [5]' to LPCTSTR
- error C2664: 'DeleteFileW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR'
- error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [20]' to 'LPCWSTR' 原因
- error:MultiByteToWideChar cannot convert parameter 2 from 'char [10]' to 'unsigned short *'
- vc++控件变量SetDlgItemText(): cannot convert parameter 1 from 'char [10]' to ‘
- 'LoadLibraryW' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR' 解决方案
- LoadCursorA' : cannot convert parameter 2 from 'const int' to 'const char *
- 使用Unicode下的cannot convert parameter 1 from 'CString' to 'const char *' 解决办法
- 类型转换 -- 使用Unicode下的cannot convert parameter 1 from 'CString' to 'const char *' 解决办法
- vs2008下cannot convert parameter 1 from 'LPCTSTR' to 'const char *'的解决方法
- error:cannot convert parameter 1 from 'unsigned char *' to 'char *'
- error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'
- GetWindowTextW(LPTSTR,int) const' :cannot convert parameter 1 from 'char[10]
- 用VC创建新线程易出的问题error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall
- cannot convert parameter 1 from 'std::string' to 'const char *'
- cannot convert parameter 1 from 'CString' to 'const char *'
- error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'char [20]' to 'LPCWSTR' 原因