基于插件架构的c/c++应用 [英] plug-in architecture based c/c++ application

查看:28
本文介绍了基于插件架构的c/c++应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何开始编写基于插件架构的应用程序.我的意思是如何编写基础代码,并通过添加他们编写的插件来让其他人开发应用程序.我知道在 C++ 中这样做有一些问题.大多数人使用另一种语言(例如 python)向他们的 C++ 应用程序添加插件.

I need to know how to start writing an application based on plug-in architecture. I mean how to write a base code and let others develop the application by adding the plug-ins they write. I know that there is some problems in doing so in c++. most people use another language such as python to add plug-ins to their c++ application.

推荐答案

我认为,这不是您期望的答案,但您可以尝试检查 Rainmeter 来源.它是用 C++ 编写的(在我看来,有些地方可以做得更好,但总体来说还可以)并且整个应用程序都是按照这种方式完成的,因此它只处理插件.

I think, this is not the answer you expect, but you could try to examine the Rainmeter sources. It's written in C++ (some places could be done better, to my mind, but overall it's ok) and the whole application is done the way so it just handles plugins.

即使是简单的 API 也是通过插件完成的,也有很多贡献的插件示例,我的意思是,由其他人编写(我有一天也这样做了).

Even the simple API is done via plugins, there is also a bunch of examples of contributed plugins, I mean, written by someone else (I did that too, one day).

我认为您实际上可以通过查看其他应用程序来研究基于插件的开发中的许多新技巧.

I think you could actually study a lot of new tricks in the plugin-based development by looking at other applications.

另外值得一提的是,另一个很好的示例是 Miranda IM.

Also to mention, another good sample is Miranda IM.

此外,如果我执行相同的任务,我实际上会向我的应用程序添加一些 python(或类似的东西)后端并将其用作语言对于 SDK(例如,使用 boost::python).

Also, if I han the same task, I would actually add some python (or something like that) backend to my application and use it as the language for SDK (for example, using boost::python).

这篇关于基于插件架构的c/c++应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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