从托管代码调用非托管DLL函数 [英] Call unmanaged dll function from managed code
问题描述
您好,
我有一个非托管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屋!