用C开发快速应用程序开发工具 [英] Developing a Rapid Application Development tool in C

查看:170
本文介绍了用C开发快速应用程序开发工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



出于学习目的,我试图找出通过Win32 API在Windows上的C中创建快速应用程序开发工具的方法.

工具用途:
1.与编写100行代码相比,使用户感到非常易于创建GUI.
例如:提供窗口的拖放选项并启用调整大小选项等,
2.为了启用一种小的脚本编制机制,用户可以通过该机制实际处理他正在准备的GUI事件.

现在,创建RAD工具分为两个部分,如下所述.

1.前端部分.
2.后端部分.

前端部分:它是主要的GUI界面,与C/C ++编译器提供的任何IDE都非常相似.

后端部分:在这里,我很感动.用户准备好他的GUI应用程序后,我想知道使最终可执行文件成为独立程序的最佳方法.我完全不知道这是否可能.

也许我可以在这里详细说明一下.一旦用户通过我的工具完成了对应用程序的设计,您可以建议我采用什么方法使该程序成为独立的可执行文件.

请注意,我不想编写新的编译器来通过我的工具将用户设计转换为机器代码.但是相反,我想将该工具作为脚本实用工具而不是为用户使用,而不是用其他语言完成的纯低级编码,这会浪费大量时间.

可能是在linux上,您可以考虑使用shell脚本实用程序,该程序使用户最终可以通过文件中嵌入的各种命令为其应用程序编写代码,然后最终在命令提示符下运行shell脚本.

一旦您查看了上面的内容,并向我询问了有关我到底想做什么的更多详细信息,我可以通过回应的方式添加更多内容.

请提出建议.

Hi,

For learning purpose, I am trying to figure out the ways to create a Rapid Application Development tool in C on Windows through Win32 apis.

Purpose of tool:
1. To make the user feel very easy to Create GUI when compared to that of writing 100''s of lines of code instead.
eg: Providing Drag and Drop options of windows and enabling re-sizing options etc.,
2. To enable a small scripting mechanism, through which the user can actually handle events of the GUI that he is preparing for.

Now there are two parts in creating the RAD tool and are mentioned as below.

1. Front end part.
2. Back end part.

Front end part: It is the main GUI interface which is very similar to any of the IDEs provided by the C/C++ compiler.

Back end Part: Here I am struck. Once the user prepares his GUI application, I want to know the best ways to make the final executable a stand alone program. I dont know if this is possible at all.

May be i can elaborate a bit more here. Once the user is done with his design of the application through my tool, what are the ways you can suggest me to make the program a stand alone executable.

Please note that I do not want to write a new compiler to convert the User design to machine code through my tool here. But instead i want to make the tool as a scripting utility instead for the user rather than pure low level coding that is done in other languages and which consumes a lot of time.

May be on linux, you can consider the shell scripting utility where the user can end up writing code for his application through various commands embedded in a file and then finally run the shell script at the command prompt.

May be once you review the above and ask me more details about what exactly i am trying to do, i can add more by way of response.

Please suggest.

推荐答案

您基本上有两种选择:

1.编写一个编译器
2.编写口译员

如果编写编译器,则不必生成机器代码,编译器可以生成C或C ++或C#代码,然后将其馈送到适当的编译器.或者,您可以生成Java字节码并在JVM中运行它,也可以生成CIL并使用CLR.

如果您编写解释器,您会发现您必须做很多与编写编译器相同的事情.

编写编译器的好处是测试通常更简单,因为您只需要检查输出并验证它是否符合输入的期望即可.
You have basically two choices:

1. Write a compiler
2. Write an interpreter

If you write a compiler, you don''t necessarily have to generate machine code, your compiler can generate C or C++ or C# code which is then fed to an an appropriate compiler. Or you can generate java-bytecode and run the thing in the JVM or you can generate CIL and use the CLR.

If you write an interpreter, you''ll find that you have to do a lot of the same things you''d have to do to write a compiler.

The advantage of writing a compiler is that testing is often simpler since you just need to examine the output and verify it is what you expected from the input.


快速应用程序开发(RAD)工具通常生成丑陋的,非人类可读的代码,然后将使用支持的语言(C,C ++,C#,...)正常编译这些代码.

困难在于将设计方面(GUI)与代码进行匹配(例如,匹配事件).

前端非常简单(但是工作量很大),您需要为要支持的所有内容(GUI,事件等)创建UI(看看Visual Studio的工作方式).

后端非常复杂(可能),将设计"转换为可行的可编译代码.这意味着手动(通过您自己的代码)创建功能代码.

例如,如果您将一个按钮添加到对话框中,并且想要添加一个事件,则需要添加代码以将按钮创建到现有对话框中(CreateWindow,...)并添加事件(例如通过message)映射(MFC),或处理DlgProc函数中的事件,...)

可以将Visual Studio视为RAD工具,看看它的工作方式:
-资源编辑器用户界面将创建一个RC文件,该文件将由资源编译器进行编译.
-将向C/C ++编译器编译的代码中添加代码(类,方法,变量,事件等)的向导.




祝你好运.
Rapid Application Development (RAD) tools usually generate ugly non human readable code that will then be compiled normally by the supporting languages (C, C++, C#, ...).

The difficulty is to match the design aspect (GUI) to the code (matching events, for examples).

The front-end is quite simple (but it is a lot of work), you need to create your UI for everything you want to support (GUI, events, ... ) (have a look at how Visual Studio is working).

The back-end is (can be) quite complex, translating the "design" to workable compilable code; this means manually (via your own code) create the functional code.

for example, if you add a button to a dialog and you want to add an event, you will need to add the code to create the button to the existing dialog (CreateWindow, ...) and add events (for example either via message maps (MFC), or handle events in DlgProc functions, ... )

Visual Studio could be considered a RAD tool, have a look at how it is working:
- The resource editor UI will create a RC file that will be compiled by the resource compiler.
- The different wizard that will add code (classes, methods, variables, events, ... ) to code that will be compiled by the C/C++ compilter.




Good luck.


这篇关于用C开发快速应用程序开发工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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