我使用的wxWidgets 2.9.4在Visual Studio 2012和我不斷收到這兩個錯誤消息:MessageBoxW不能轉換
錯誤1個錯誤C2664:「MessageBoxW」:不能從「爲const char *」轉換參數2 'LPCWSTR'
智能感知:類型 「爲const char *」 的說法是,類型爲 「LPCWSTR」 參數
我的代碼是不兼容的:
#ifdef _WIN32
std::string msg;
StringFromFormatV(&msg, format, args);
retval = IDYES == MessageBox(0, msg.c_str(), "ERROR! Continue?", MB_ICONQUESTION | MB_YESNO);
[無法將參數2從'const char \ [14 \]'轉換爲'LPCWSTR']的可能重複(http://stackoverflow.com/questions/15592906/cannot-convert-parameter-2-from-const -char-14-to-lpcwstr) – tinman
除了下面的解決方案之外,爲什麼使用Win32':: MessageBox()'無論如何使用wxWidgets?只需使用'wxMessageBox()'。 –