7#include "../macros.hpp"
8#include "win32_error_intf.hpp"
9#include "stringapiset.hpp"
15hi_export_module(hikogui.win32 : winbase);
17hi_export
namespace hi {
inline namespace v1 {
19[[nodiscard]]
inline std::expected<std::string, win32_error> win32_FormatMessage(win32_error error_code)
noexcept
21 auto const error_code_ =
static_cast<DWORD
>(std::to_underlying(error_code));
25 LPWSTR buffer =
nullptr;
26 auto const result = ::FormatMessageW(
27 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
30 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
31 reinterpret_cast<LPWSTR
>(&buffer),
The HikoGUI namespace.
Definition array_generic.hpp:20
std::expected< std::string, win32_error > win32_WideCharToMultiByte(std::wstring_view s, unsigned int code_page=CP_UTF8, uint32_t flags=0) noexcept
Convert a win32-API compatible std::wstring to a multi-byte std::string.
Definition stringapiset.hpp:26
DOXYGEN BUG.
Definition algorithm_misc.hpp:20