从导出DLL中的函数指针 [英] Exporting a function pointer from dll

查看:89
本文介绍了从导出DLL中的函数指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个dll文件的函数指针(中实现,而不是标头)。我如何调用该函数通过该指针的exe文件源$ C ​​$ C指向?

I have a function pointer in a dll file (in implementation, not header). How can I call the function pointed to by this pointer in the exe source code?

推荐答案

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

you can export a function returning the pointer. Header:

typedef void ( *MyPtr ) ();

__declspec( dllexport ) MyPtr GetMyPtr();

来源:

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

这篇关于从导出DLL中的函数指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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