本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/142058580
插件加载目录结构
execute
plug.exe
plugify.dll
plugify.pconfig
res
cpp-lang-module.pmodule
example_plugin.pplugin
bin
cpp-lang-module.dll
example_plugin.dll
plugify.pconfig
{
“baseDir”: “res”,
“logSeverity”: “debug”,
“repositories”: [
],
“preferOwnSymbols”: false
}
example_plugin.pplugin
{
“fileVersion”: 1,
“version”: 1,
“versionName”: “1.0”,
“friendlyName”: “PluginCPP”,
“description”: “An example of a plugin. This can be used as a starting point when creating your own plugin.”,
“createdBy”: “untrustedmodders”,
“createdByURL”: “https://github.com/untrustedmodders/“,
“docsURL”: “https://github.com/orgs/untrustedmodders/README.md“,
“downloadURL”: “https://github.com/orgs/untrustedmodders/example-repo.zip“,
“updateURL”: “https://github.com/untrustedmodders/plugify/issues“,
“entryPoint”: “bin/example_plugin”,
“supportedPlatforms”: [],
“languageModule”: {
“name”: “cpp”
},
“dependencies”: [],
“exportedMethods”: [
{
“name”: “MakePrint”,
“funcName”: “MakePrint”,
“paramTypes”: [
{
“type”: “int32”,
“name”: “count”
},
{
“type”: “string”,
“name”: “message”
}
],
“retType”: {
“type”: “void”
}
}
]
}
cpp-lang-module.pmodule
{
“fileVersion”: 1,
“version”: 0,
“versionName”: “v0”,
“friendlyName”: “Cpp language module”,
“language”: “cpp”,
“description”: “Adds support for C++ plugins”,
“createdBy”: “untrustedmodders”,
“createdByURL”: “https://github.com/untrustedmodders/“,
“docsURL”: “https://github.com/untrustedmodders/cpp-lang-module/blob/main/README.md“,
“downloadURL”: “https://github.com/untrustedmodders/cpp-lang-module/releases/download/v0/cpp-lang-module.zip“,
“updateURL”: “https://untrustedmodders.github.io/cpp-lang-module/cpp-lang-module.json“,
“supportedPlatforms”: [],
“forceLoad”: false
}
插件定义
1 |
|
模块定义
1 |
|
测试
1 | plug.exe |
参考
GitHub - untrustedmodders/cpp-lang-module: C++ Language Module
创作不易,小小的支持一下吧!

