>It looks like your target function is not Unicode-safe. It expects ANSI data. That was it. I rebuilt the lib with Unicode turned on and now: reinterpret_cast<const TCHAR* const>(portName.data()) works as you said. Thanks for the tip.