从托管代码调用非托管DLL函数 [英] Call unmanaged dll function from managed code

查看:151
本文介绍了从托管代码调用非托管DLL函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个非托管C ++ DLL。我想在没有DllImport的情况下使用它,但是使用LoadLibrary,FreeLibrary和GetProcAddress来获取导出的每个函数的函数指针。我的问题如下:如何在.Net Compact Framework
2.0中调用函数指针? .Net Framework有Marshal.GetDelegateFromFunctionPointer,但这个函数在CF 2.0中不存在。


任何想法,


保罗。

解决方案

浏览下面的链接。特别是Chris Tacke回复。


http://www.eggheadcafe.com/software/aspnet/30191711/load-unmanaged-dll-in-runtime.aspx


Hello,

I have a unmanaged C++ DLL. I want to use it without DllImport but using LoadLibrary, FreeLibrary and GetProcAddress to get the function pointer of each function exported. My problem is the following : how can I call a function pointer in .Net Compact Framework 2.0 ? The .Net Framework has Marshal.GetDelegateFromFunctionPointer, but this function doesn't exist in CF 2.0.

Any idea,

Paolo.

解决方案

Go through the bellow link. especially Chris Tacke reply.

http://www.eggheadcafe.com/software/aspnet/30191711/load-unmanaged-dll-in-runtime.aspx


这篇关于从托管代码调用非托管DLL函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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