Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个给定的 LPCWSTR 变量,它包含一个完整的路径。
我只想从中提取文件名。
有什么建议我可以如何操纵 LPCWSTR 来实现这一目标?
另外 - 如何在 LPCWSTR 的特定索引中获取字符?
谢谢你。
Windows 功能PathStripPath会做你想做的事。由于您有一个 Unicode 字符串,因此您需要调用“W”版本的 PathStripPathW。