且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从托管代码调用非托管DLL函数

更新时间:2023-02-15 21:35:57

浏览下面的链接。特别是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