long result = (long)ShellExecute(0, 0, reinterpret_cast<const WCHAR*>("test.csv"), 0, 0, SW_NORMAL); // << Incorrect
long result = (long)ShellExecute(0, 0, L"test.csv", 0, 0, SW_NORMAL); // << Correct
long result = (long)ShellExecute(0, 0, reinterpret_cast<const WCHAR*>("test.csv"), 0, 0, SW_NORMAL); // << Incorrect
long result = (long)ShellExecute(0, 0, L"test.csv", 0, 0, SW_NORMAL); // << Correct
To copy to clipboard, switch view to plain text mode
But QDesktopServices is much better and more portable.
"Hello" << ASCII Text string
L"Hello" << Unicode text string
"Hello" << ASCII Text string
L"Hello" << Unicode text string
To copy to clipboard, switch view to plain text mode
Also, if you build a non-unicode version of your app for some reason, all strings prefixed with L will immediately generate ascii string instead of unicode strings.
Bookmarks