跨平台函数替换GetLogicalDriveStrings() [英] A cross platform function to replace GetLogicalDriveStrings()
本文介绍了跨平台函数替换GetLogicalDriveStrings()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我需要使用Microsoft的GetLogicalDriveStrings()函数来检索驱动器列表.
有什么功能可以代替该功能,以使我的代码跨平台?
非常感谢您
Hi all, I need to use the Microsoft''s GetLogicalDriveStrings() function to retrieve the drives list.
Is there any function to replace that function, in order to make my code cross-platform?
Thank you very much
推荐答案
在大多数情况下,从平台迁移到另一个平台时,没有等效的 API .编写跨平台代码意味着要写下一系列#ifdef
指令,这些指令取决于活动平台,以便您根据平台API以不同的方式进行工作.
编写跨平台软件是一项非常复杂的任务.幸运的是,有框架正在处理它.
为什么不看看 Qt-跨平台应用程序和UI框架 [ wxWidgets [ ^ ]
In the most of cases there is not an equivalent of an API when moving from a platform to another; writing cross-platform code then mean to write down a series of#ifdef
directives, dependant to the active platform, so that you make your work in a diferent way depending on the platform API.
To write cross-platform software is a very complex task; fortunately there are frameworks that deal with it.
Why don''t you have a look to Qt - A cross-platform application and UI framework[^] or wxWidgets[^]
这篇关于跨平台函数替换GetLogicalDriveStrings()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文