You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per the UTF-8 Everywhere Manifesto, it's best to not rely on the legacy ANSI .vs UNICODE macros for Win32 functions that take strings. Since you explicitly use an ANSI string for the call to LoadLibrary you should explicitly use the LoadLibraryA method.
This causes problems when trying to build your library using vcpkg manager when the setup adds the recommended UNICODE _UNICODE defines.
In exception.cpp use FormatMessageA instead of FormatMessage.
The text was updated successfully, but these errors were encountered:
Ugh. The Win32 API just confuses the hell out of me! But thanks for the tip. Let me know if you spot anything else. I'll look to get a little fix release out in the next few weeks.
BTW... If you have a suggestion for a better way to do this, let me know.
Blame on back-compat with 16-bit Windows and the transition from ANSI to Unicode :)
LoadLibrary and FormatMessage aren't actually functions. They are just macros based on MBCS vs. UNICODE settings. By explicitly calling LoadLibraryA you are ignoring those crazy macros. For more information on why this is a 'best practice' these days, see UTF-8 Everywhere.
Ha. Yeah, I'm so old, the last time I programmed Windows professionally, I was dealing with segments and offsets, not Unicode! I didn't realize those agnostic "functions" were actually macros. Thanks.
Per the UTF-8 Everywhere Manifesto, it's best to not rely on the legacy ANSI .vs UNICODE macros for Win32 functions that take strings. Since you explicitly use an ANSI string for the call to
LoadLibrary
you should explicitly use theLoadLibraryA
method.In exception.cpp use
FormatMessageA
instead ofFormatMessage
.The text was updated successfully, but these errors were encountered: