See best practices including wchart project: https://learn.microsoft.com/en-us/dotnet/standard/native-interop/best-practices Perhaps use some wchart converter for library import instead of WCharT library which surfaces low level details?