如何在html中使用C ++ [英] How to use C++ with html

查看:249
本文介绍了如何在html中使用C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有c ++银行界面的大学项目。我想设计表格,我可以创建新帐户,存钱和取款。我想为此使用c ++。我怎样才能做到这一点。我知道所有基本的c ++和html。



谢谢

i have college project of c++ banking interface. i want to design form where I can create new account, deposit money and withdraw money. I want to use c++ for this. How can I achieve this. i know all basics of c++ and html.

thanks

推荐答案

我相信你的问题概念。您想要使用HTML创建用户界面,使用C ++创建应用程序。这是可以实现的。



选项1:HTML和C ++代码驻留在客户端 -



你可以用MFC实现这一点。这是一个mfc 示例这样做。除了MFC之外,在尝试开发HTML解析器时你将无处可去。



选项2:使用HTTP,



您可以在Linux操作系统中安装Apache服务器并配置和启用cgi,通过它可以处理用户请求和所有事务。在这种情况下,您的C ++应用程序将在服务器上运行,HTML将在客户端运行。
I believe you have problem with your concept. You want to create user interface with HTML and your application with C++. Which is achievable.

option 1: HTML and C++ code resides in client side-

You can achieve this with MFC. Here is an mfc example for doing this . Other than MFC you will end up nowhere while trying to develop an HTML parser.

Option 2: Using HTTP,

You can install Apache server in linux os and configure and enable cgi, through which you can process user request and all transactions. In this case your C++ application will run at server and HTML will run at client side.


您实际上可以使用名为Wt的工具包(类似于Qt的API)在C ++中创建Web应用程序。有一个独立的浏览器以及Apache的模块。这样您就可以像使用C#一样使用C ++作为编程语言,因此您也可以使用现有的C ++代码。但它并不是很优雅。



我实际上建议你学习Qt并在其上面编写整个应用程序。它非常便携,并且几乎可以为所有内容提供广泛的API - 它是一个应用程序框架; GTK +只是用户界面,在C语言中,尽管用于C ++的GTKmm包装器很不错。请访问http://qt.nokia.com查看 - 它可以在GNU LGPL下找到。
You can actually create web applications in C++ using a toolkit called Wt (similar API to Qt). There is a standalone browser as well as a module for Apache. This way you can use C++ as your programming language the same way you would C# with ASP.NET, and thus you can also use your existing C++ code. It's not really elegant though.

I'd actually recommend you learn Qt and write the whole application on top of it. It's incredibly portable and has an extensive API for just about everything - it's an application framework; GTK+ does just the UI, and in C, although the GTKmm wrapper for C++ is nice. Check it out at http://qt.nokia.com - it's available under the GNU LGPL.


这篇关于如何在html中使用C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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