控制台到图形用户界面 [英] Console to Graphical User Interface

查看:140
本文介绍了控制台到图形用户界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用c ++编写程序。我正在使用visual visual studio 2012.在我的程序中有很多图形元素,如aircrft,雷达等。我已经在win32控制台应用程序中编写了程序。在我的程序中有许多头(.h)文件以及许多(.cpp)文件。现在我想通过复制那些头文件和cpp文件在图形用户界面(GUI)中运行我的程序。在这种情况下我该怎么办?请通过一个例子给我一个解决方案。

I write a program using c++. I am using visual visual studio 2012.In my program there are many graphical element such as aircrft, radar etc. I have written the program in win32 console application. In my program there are many header (.h) files as well as many (.cpp) files. Now I want to run my program in Graphical User Interface (GUI) by copying those header files and cpp files. what can i do in this situation. please give me a solution by an example.

推荐答案

你的问题有点复杂,缺乏很多细节。您描述的大多数问题可以通过遵循一本关于Windows操作系统的C ++编程的合理书籍来解决(即Visual Studio / C ++书,而不是Stroustrup的C ++书)。



[没有网址;参考纸质书......]
Your question is somewhat complex and lacking in a lot of details. Most of the issues you describe can be worked out by following a reasonable book on C++ programming for a Windows operating system (ie. a Visual Studio/C++ book, not Stroustrup''s C++ book).

[No url here; refer to a paper book...]


花一些时间学习 Windows编程 [ ^ ]和 Windows GDI + [< a href =http://msdn.microsoft.com/en-us/library/ms533798(VS.85).aspx\"target =_ blanktitle =New Window> ^ ]如何在Windows中绘制图形图像。
Spend some time studying Windows programming[^] and Windows GDI+[^] for details of how to draw graphical images in Windows.


我认为这样做的方法很少......



Going Native

从头开始构建所有内容(好吧......,根本不是)。这些是最快的图形用户界面。平台总是有这种API集(一个和唯一的)。在Windows中,它是 Win32 API 。我在Mac上听说过它是 Cocoa API 。它们是:

>>操作系统依赖。



特定平台周围的包装

第二级。这是一个框架,仅用于最小化Native API的代码,或使其更简单。 Native和this之间可能存在微小的性能差异。 (有时候真的没关系)。对于Win32,有一个名为 MFC 的框架, WTL ,......(你可能听说过它们)。这些'

>>操作系统依赖。



使用跨平台工具包(或框架)

完全便携。上述两种方式较慢。但是可以帮助你快速发展。易学易懂。 QT KDE 就是例子。 (真的,有)。



我总是喜欢GUI的第一种方式,即'Going Native''。但这是你的选择!
I think there''re only few ways of doing so...

Going Native
Build everything from scratch (well.., not at all). These are the Fastest GUIs around. A platform always have a this kind of API set (one & only). In Windows it''s Win32 API. I''ve heard that in Mac it''s Cocoa API. These are :
>> OS dependent.

Wrappers around a specific Platform
2nd level. This is a framework, that is used only to minimize the code of the Native API, or to make it more simpler. There''re may be a tiny performance difference between the Native and this. (it really doesn''t matter sometimes). For Win32, there''re frameworks called MFC, WTL ,... (you may have probably heard about them). These''re
>> OS dependent.

Use cross-platform toolkits (or Frameworks)
Completely portable. Slower that the above two ways. But can help you in Rapid Developments. Easy to learn and simple. QT and KDE can be examples. (really, there are).

I always like the 1st way of GUI, which is ''Going Native''. But it''s your choice !


这篇关于控制台到图形用户界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆