Fri, 22 Sep 2023 21:32:45 +0200
create WinUI wrapper classes for usage in UiObject and widget creation functions
#include "util.h" #include <stdlib.h> #include <Windows.h> wchar_t* str2wstr(const char* str, int* newlen) { size_t len = strlen(str); wchar_t* wstr = (wchar_t*)calloc(len + 1, sizeof(wchar_t)); int wlen = MultiByteToWideChar( CP_UTF8, 0, str, len, wstr, len + 1 ); if (newlen) { *newlen = wlen; } wstr[wlen] = 0; return wstr; }