LoadString
C / C++ / MFC
3
Posts
3
Posters
1
Views
1
Watching
-
how to use LoadString in c++
-
how to use LoadString in c++
The Windows API LoadString() expects a buffer, not a C++ string. The easiest way to use it would be something like:
std::wstring GetStringW(HINSTANCE hinst, UINT id)
{
std::vector buffer(256);::LoadStringW(hinst, id, buffer.data(), static\_cast(buffer.size())); return &buffer\[0\];
}
which would convert the buffer into a std::wstring.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
how to use LoadString in c++