What it takes to pass a file path to a Windows API in C++
Alternative sane approach:<p>- Forget about long paths unless you really need to care. You need to care if you&#x27;re accepting a file path from another app, for example. You don&#x27;t need to care if you&#x27;re using your own files in your install directory; too much of Windows doesn&#x27;t support long files (including explorer, as mentioned, not to mention third party apps), so it&#x27;s very unlikely that you&#x27;ll need to deal with them if you&#x27;re just handling your own data.<p>- Work in utf-16 when dealing with file paths. Convert back and forth at the point of entry &#x2F; exit to &#x2F; from your app. It&#x27;s unsurprising that you need to call the conversion function twice in order to find out how much memory to allocate, that&#x27;s just how that works.<p>Don&#x27;t change random registry settings or code pages on the user&#x27;s computer, that&#x27;s mad.