1 / 2 / 0
Регистрация: 06.12.2013
Сообщений: 115
|
||||||
1 | ||||||
Исправить ошибки "cannot convert 'std::__cxx11::string'"16.09.2018, 20:54. Показов 1108. Ответов 3
Метки нет (Все метки)
Всем привет!
Часть кода:
Код
||=== Build: Release in dialogText (compiler: GNU GCC Compiler) ===| C:\Users\W0LF\Dropbox\src\CPP\dialogText\main.cpp||In function 'BOOL DlgMain(HWND, UINT, WPARAM, LPARAM)':| C:\Users\W0LF\Dropbox\src\CPP\dialogText\main.cpp|38|error: cannot convert 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} to 'LPSTR' {aka 'char*'}| C:\mingw32\i686-w64-mingw32\include\winuser.h|2358|note: initializing argument 3 of 'UINT GetDlgItemTextA(HWND, int, LPSTR, int)'| C:\Users\W0LF\Dropbox\src\CPP\dialogText\main.cpp|40|error: cannot convert 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} to 'LPSTR' {aka 'char*'}| C:\mingw32\i686-w64-mingw32\include\winuser.h|2358|note: initializing argument 3 of 'UINT GetDlgItemTextA(HWND, int, LPSTR, int)'| C:\Users\W0LF\Dropbox\src\CPP\dialogText\main.cpp|44|error: cannot convert 'std::__cxx11::string' {aka 'std::__cxx11::basic_string<char>'} to 'LPCSTR' {aka 'const char*'}| C:\mingw32\i686-w64-mingw32\include\winuser.h|2356|note: initializing argument 3 of 'WINBOOL SetDlgItemTextA(HWND, int, LPCSTR)'| ||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|
0
|
16.09.2018, 20:54 | |
Ответы с готовыми решениями:
3
No match for 'operator<' (operand types are 'std::__cxx11::string {aka std::__c ошибка error: cannot convert 'std::string {aka std::basic_string<char>}' to 'std::string* {aka std::basic_stri Std::string and std::wstring convert ошибка в программе (cannot convert 'std::string {aka std::basic_string<char>}' to 'const char*') |
86 / 85 / 4
Регистрация: 20.11.2016
Сообщений: 259
|
||||||
16.09.2018, 21:40 | 2 | |||||
Очередной новичок в программировании WinAPI???
Несовместимые параметры. В программе buf имеет тип string. А в описании функции он должен иметь другой тип LPTSTR
1
|
1 / 2 / 0
Регистрация: 06.12.2013
Сообщений: 115
|
|||||||||||
16.09.2018, 22:00 [ТС] | 3 | ||||||||||
Да, а что?
Ok, вписал приведение типов:
Вот полный текст проги:
0
|
32 / 30 / 4
Регистрация: 01.02.2014
Сообщений: 878
|
||||||
16.09.2018, 22:26 | 4 | |||||
1
|
16.09.2018, 22:26 | |
16.09.2018, 22:26 | |
Помогаю со студенческими работами здесь
4
Ошибка Cannot convert std::string to void* cannot convert parameter 1 from 'int' to 'std::string &' Перегрузка операторов: cannot convert ‘std::string’ to ‘char*’ Ошибка при компиляции std::__cxx11::basic_string<char Ошибки Cannot convert и Statement missing. Как исправить? Ошибка при компиляции "Cannot convert `std::string' to `const char*" Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |