如何在纯粹的“C”中从DLL文件创建插件API。 [英] How to create plugin API from a DLL file in pure "C"

查看:75
本文介绍了如何在纯粹的“C”中从DLL文件创建插件API。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要简单的解决方案如何创建/实现插件表单DLL以及如何在我们的程序中动态加载它。使用纯c编程。



我尝试过:



i有创建DLL文件。我必须在c程序中从该DLL创建一个简单的插件并使用GCC运行它。

i want the simple solution how t create/implement the Plugin form DLL and how to load it dynamically in our program. using pure c programing.

What I have tried:

i have create the DLL file .i have to create a simple plugin from that DLL in c program and run it using the GCC.

推荐答案

你需要调用两个函数:LoadLibrary将DLL加载到进程的地址空间和GetProcAddress以获取库中函数的地址。它们都有详细记录,周围有大量样本可以确切了解它们的使用方式。
You need to call two functions : LoadLibrary to load the DLL into your process' address space and GetProcAddress to get the address of a function in the library. They are both well-documented and there are plenty of samples around to see exactly how they are used.


这篇关于如何在纯粹的“C”中从DLL文件创建插件API。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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