Flex - C ++连接? [英] Flex -- C++ connection?
问题描述
如何连接Flex应用程序(互联网站点)和C ++ togehter?
How do I connect a Flex Application( Internet Site ) and C++ togehter ?
一个简单的例子,从我的意思(用户故事):
Frank去www.myflexsite.de有2个文本框和1个Button(Label =添加两个数字)。
他在第一个文本框中插入2,在第二个文本框中插入5。现在他点击添加按钮。
a minimalistic example from what i mean (User Story): Frank goes to www.myflexsite.de there are 2 textboxes and 1 Button( Label = add two numbers) . He inserts 2 in the first textbox and 5 in the ohter. Now he clicks on the add button.
后端:我们有一个add.cpp文件,其中定义了一个add方法:
The Backend : We have a add.cpp file where an add method is defined :
int add(int a, int b ) ...
在Frank点击添加两个数字按钮之后,C ++文件中的添加方法被调用,并返回结果。将出现一个警告窗口,并显示结果。
After Frank clicked on the "add two numbers" Button the add-method in the C++ file is called and the result will be returned.An Alert Window with the result appears.
这是我想要完成的,但我不知道如何建立这两种语言之间的桥梁。
他们如何沟通?
This is what i want to accomplish, but i don't know how i build the bridge between these 2 Languages. How can they communicate ?
推荐答案
最简单的方法是写一个小控制台应用程序,然后通过Apache或任何其他使用CGI的Web服务器调用它。这里有性能问题,但它是一个好的开始,然后你可以前进。从Flex只需发出HTTP请求,让你的程序解析它们 - 例如,你可以来回发送XML。
The easiest would be to write a small console application in C++ and then invoke it via Apache or any other web server using CGI. There are performance problems with this but it's a good start, and then you can move forward. From Flex just make HTTP requests and let your program parse them - for instance, you can send XML back and forth.
这篇关于Flex - C ++连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!