c - 从 dll 导出函数指针

标签 c windows dll function-pointers

我在一个 dll 文件中有一个函数指针(在实现中,而不是头文件中)。在exe源码中如何调用this指针指向的函数?

最佳答案

您可以导出返回指针的函数。 header :

typedef void ( *MyPtr ) ();

__declspec( dllexport ) MyPtr GetMyPtr();

来源:

MyPtr GetMyPtr()
{
  //retunr the function pointer here
}

关于c - 从 dll 导出函数指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7764074/

相关文章:

dll - 在 Windows 中分发基于 wxHaskell 的应用程序

c - ATMEGA168A - 使用定时器

c++ - gSOAP 2.8.30 与 VS6 C++ 的兼容性

Python:无法在 Windows 中连续捕获键盘中断?

windows - CMD - 等待并行命令行完成?

C# Dll 库不向 Delphi 应用程序返回输出参数值

c++ - GetProcAddress 与所有加载的库

c - 当我释放分配的内存时出现 munmap_chunk() 错误

c - #include<>'ing 不同版本的 Python.h 并链接多个版本的 Python

windows - 在一个进程(通过 pid)完成后运行命令