cannot convert parameter 3 from 'const unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
類型不匹配:參數 3 傳入的是 const unsigned short*(寬字符/UTF-16 指針),但函數期望 const char*(窄字符指針)。兩者指向的類型無關,無法隱式轉換。
unsigned short 和 char 都是整數就能互轉。unsigned short* 常用於 UTF-16/wchar_t 字符串,char* 用於 ANSI/UTF-8。wchar_t/TCHAR。WideCharToMultiByte / MultiByteToWideChar 或 std::wstring_convert 進行編碼轉換,而非強制類型轉換。切忌使用 reinterpret_cast 強行壓制編譯器,會導致運行時訪問違規或亂碼。