我正在尝试使用结构创建一个任务对话框TASKDIALOGCONFIG
。我的应用程序使用 Unicode。这是我的代码:
string error_text = get_error_text();
string error_code = get_error_code();
TASKDIALOGCONFIG tdc = { sizeof(TASKDIALOGCONFIG) };
tdc.dwCommonButtons = TDCBF_OK_BUTTON;
tdc.pszMainIcon = TD_ERROR_ICON;
tdc.pszWindowTitle = _T("Error");
tdc.pszContent = error_text.c_str(); /* of course this will give a
const char* instead of a wchar_t* */
tdc.pszExpandedInformation = error_code.c_str(); // here is the same thing
tdc.hwndParent = m_wndParent;
TaskDialogIndirect(&tdc, NULL, NULL, NULL);
我已经研究了这个问题,但我还没有找到解决方案。有人可以帮助我吗?