针对 Mac/Unix 开发人员的 MS Windows 编程建议

发布于 2024-10-01 20:40:49 字数 445 浏览 3 评论 0 原文

我有几年用 python、C 和 C++ 编写 Unix 命令行工具的经验(没有 GUI 经验),最近才跨入 GUI 世界(仅限 Cocoa 和 IOS)。我已经学习了相当多的 Objective-C 知识,并且正在了解 cocoa MVC 的工作原理。然而,我正在开发的应用程序之一需要 Windows 版本,我想知道考虑到我完全没有 Windows 开发经验,什么是一个好的起点。

我正在考虑使用 Visual C++ 2010 Express 作为我的开发平台(因为它是免费的,而且我不需要学习 C++)。我的应用程序相对简单,它只有两个窗口,并且大部分时间在后台运行。然而,它需要与操作系统(加载 dll 等)和在线服务器(HTTP 方法)进行通信,并且我不确定 Visual C++ Express 版本是否允许我访问所需的 API。 Windows 窗体应用程序就足够了吗?我是否以错误的方式处理这个问题?我需要学习 C# 吗?任何建议将不胜感激。

I have a few years of experience writing Unix command line tools (no GUI experience) in python, C and C++, and only recently crossed into the GUI world (Cocoa and IOS only). I've learned quite a bit of objective-C and am getting to understand how cocoa MVC works. However, one of the apps I am developing needs a Windows version and I was wondering what a good place to start would be given that I have absolutely no Windows development experience.

I was thinking about using Visual C++ 2010 Express as my development platform (because it's free and because I don't need to learn C++). My application is relatively simple, it will have only two windows and spend most of the time running in the background. It will however need to communicate with the OS (load dll's etc) and an online server (HTTP methods) and I'm not sure whether Visual C++ Express edition gives me access to the required API's. Would a Windows Forms application suffice? Am I going about this the wrong way? Do I need to learn C#? Any advice will be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

月下凄凉 2024-10-08 20:40:49

如果您已经对正确的 C++ 感到满意,那么 Visual Studio C++ Express 应该很适合您。鉴于您没有制作复杂的 GUI,您甚至不需要深入研究托管代码 - C++ Express 允许您创建适当的 C++ 控制台和 GUI 应用程序。您也不需要安装平台 SDK - 它是 VS C++ Express 的一部分。

不被托管 C++,您将能够在各个项目之间共享源文件。托管 c++,尽管名称中包含 c++,实际上是一种足够不同的语言,如果您同时必须处理 iso C++,那么使用起来会很烦人。

--

注意:本机 Windows API 是 C api,而不是 C++ 框架。因此它没有在一个连贯的框架中提供丰富的类集来处理。另一方面,虽然它很大,但使用起来实际上很简单。

另外:鉴于您已经熟悉 Mac 开发,有一个名为 CFLite 的 LGPL (iirc) 包,它构建在 Windows 上并实现了作为 Objective-C Cocoa API 基础的 C api。

如果您使用它的抽象,您可以在 Windows 和 Mac(以及其他平台)之间共享大部分代码。

您可能需要考虑的其他 C++ IDE:

  • Code::Blocks
  • QT Creator

,两者都可以配置为使用 GCC 到 Windows 的 MINGW 端口。

If you are already happy with proper c++, visual Studio C++ express should suit you fine. Given that you are not making a complicated GUI, you don't even need to dip into the managed code - C++ express allows you to create proper c++ console and GUI apps. You also don't need to install the platform SDK - it is part of VS C++ express.

Not being managed C++, you will be able to share source files between your various projects. managed c++, despite the c++ in the name, really is a different enough language that it will be annoying to work with if you simultaneously have to deal with iso C++.

--

Note: The native windows API is a C api, not a C++ framework. So it does not provide a rich set of classes in a coherent framework to deal with. On the other hand, while, large, it is actually quite simple to work with.

Also: Given that you are already familiar with Mac development, there is a LGPL (iirc) package called CFLite that builds on windows and that implements the C api that underlays the Objective-C Cocoa API.

If you use its abstratcions you can share a greater part of code between windows and Mac (and other platforms).

Other C++ IDE's you might want to consider:

  • Code::Blocks
  • QT Creator

both of which can be configured to use the MINGW port of GCC to windows.

眉黛浅 2024-10-08 20:40:49

如果你需要更多“低级”的东西,你会比 C# 更好地使用 C++。加载 dll(即 lib)很简单(pragma comment lib...),就像纯 HTTP 传输和通信一样。

所以,带有windows窗体的VC++就足够了,而且它“非常c++”。

您可以访问所有全局 API,加载特定的 API(例如 http)只需要两行:一行包含 wininet 标头,另一行是 lib(库实际上是对 dll 的“引用”)。

you'll be better off with c++ than c# if you need more "low-level" stuff. Loading dlls (that is, libs) is simple (pragma comment lib...), as is pure HTTP transfer and communication.

So, VC++ with windows form will suffice, and it is "very c++".

You have access to all global APIs, and loading specific apis like http requires only two lines: one to include wininet header, and other lib (libs are actually "references" to dlls).

美胚控场 2024-10-08 20:40:49

如果您采用 C++ Express 方式,则需要单独安装 Windows SDK,并对其进行设置以供 Visual Studio 使用。而且你不能使用MFC。

不过,我建议使用 C#,因为它感觉就像把小玩具积木放在一起。更容易调试和维护。 C# 的问题是它有太多的库函数,你不可能知道你想要的函数是否已经存在。但这就是我们在这里的原因:-) 如果您觉得您想做的事情应该已经存在,那么请提出有关它的问题。 C# 缺乏的一个显着功能是 zip 存档(它有类似的功能,但不完全一样)。对于 zip,您可以使用公共库,例如 SharpZipLibDotNetZip

If you go the C++ Express way then you need to install Windows SDK separately, and set it up for Visual Studio to use it. And you can't use MFC.

I would however, suggest C#, because it feels like putting little toy bricks together. Easier to debug and maintain. Problem with C# is that it has so many library functions that you can not possibly know if what you want is already made to a function. But that's why we are here :-) If you feel that something you want to do should already exist then ask a question about it. One notable feature that C# lacks is zip archives (it has something similar, but not quite). For zips you can use public libraries, like SharpZipLib or DotNetZip.

森林迷了鹿 2024-10-08 20:40:49

如果我是你,我不会这么快就开始使用全新的 API。您考虑过在 Windows 上使用 Python 吗?我见过的大多数 Python 包也适用于 Windows,因此您会有宾至如归的感觉。如果您需要一些 GUI,您可以选择 wxPython、pyGTK 或类似的东西。

对于 Windows 特定的事情,您始终可以使用 ctypes。特别是如果它们像加载 DLL 一样简单。

If I were you, I wouldn't jump into a whole new API so quickly. Have you considered using Python on Windows? Most of the Python packages I've seen are also available for Windows, so you'll feel at home. And if you need some GUI, you can opt for wxPython, pyGTK or something similar.

For Windows specific things, you can always use ctypes. Especially if they're as simple as loading a DLL.

奢欲 2024-10-08 20:40:49

您是否考虑过使用 Adob​​e AIR?它允许您在 Mac、Linux、Windows、iOS 等上进行部署。自 2.0 以来,可以与本机进程通信并启动本机进程,最新的 2.5 SDK 可以针对 Android 操作系统和电视。根据您的经验,您应该能够立即掌握 ActionScript3 / MXML。

此外,还有一些免费 IDE 可以与 Flex 和 AIR SDK 一起使用。或者,如果您是学生或低收入开发人员,您可以从 Adob​​e 获取 Flash Builder 4 的免费副本: http://www.adobe.com/devnet-archive/flex/free/


编辑:我相信在 iPhone 上部署 AIR 应用程序需要 Flash Professional CS5,其中包括适用于 iPhone 选项的打包程序。同时,我了解到 AIR 和其他 iOS 交叉编译器速度非常慢,因此最好在 iOS 的 Objective-C 中进行本地开发。

have you considered approaching Adobe AIR? it allows you to deploy on Mac, Linux, Windows, iOS, etc. communicating with and launching native processes has been possible since 2.0 and the the latest 2.5 SDK can target Android OS and TVs. with your experience you should be able to pick up ActionScript3 / MXML in no time.

additionally, there are a handful of free IDEs you can use with the Flex and AIR SDKs. or, if you're a student or low-income developer, you can get a free copy of Flash Builder 4 from Adobe: http://www.adobe.com/devnet-archive/flex/free/


edit: i believe deploying AIR applications on iPhone requires Flash Professional CS5, which includes the packager for iPhone options. at the same time, i've read that AIR and other cross-compilers for iOS are painfully slow, so it's perhaps best to develop natively in Objective-C for iOS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文