Hey, this is an English text. I want you to translate it into the Tunisian dialect.…
- User
Hey, this is an English text. I want you to translate it into the Tunisian dialect. Please follow these steps:
- Translate step by step and highlight differences between Tunisian dialect and Modern Standard Arabic.
- Highlight sections you are confident translating into the Tunisian dialect. Translate this text into the Tunisian dialect, focusing on capturing the essence of the language nuances:
Q: Qstring to LPCWSTR LPCWSTR path; void WinApiLibrary::StartProcess(QString name) { path = name.utf16(); CreateProcess(path, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); } C:\kursovaya\smc\winapilibrary.cpp:21: error: invalid conversion from 'const ushort* {aka const short unsigned int*}' to 'LPCWSTR {aka const wchar_t*}' [-fpermissive] path = name.utf16(); This code worked in the Qt 4.8, but now i have Qt 5.2 and this code isn't working. What's wrong with this guy? A: I had the same issue (I'm using Qt 5.3), this is how I fixed it: QString strVariable1; LPCWSTR strVariable2 = (const wchar_t*) strVariable1.utf16(); A: QString::utf16() returns const ushort*, which is different from const wchar_t*, so you have the compile error. You are probably compiling with /Zc:wchar_t. If you change it to /Zc:wchar_t- it should work, as wchar_t type becomes typedef to 16-bit integer in this case. In Visual Studio: Project Properties->Configuration Properties->C/C++->Treat WChar_t As Built in Type->No. Or just add reinterpret_cast. A: I'm using Qt 5.2 and I had the same issue. This is how I fixed it: QString sPath = "C:\Program File\MyProg"; wchar_t wcPath[1024]; int iLen = sPath.toWCharArray(wcPath);
- Assistant